<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Django: How to ensure the function name and context name are the same for context processing</title>
	<atom:link href="http://www.elfsternberg.com/2009/09/17/django-how-to-ensure-the-function-name-and-context-name-are-the-same-for-context-processing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elfsternberg.com/2009/09/17/django-how-to-ensure-the-function-name-and-context-name-are-the-same-for-context-processing/</link>
	<description>Done, and gets things smart.</description>
	<lastBuildDate>Fri, 03 Feb 2012 14:39:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Elf Sternberg</title>
		<link>http://www.elfsternberg.com/2009/09/17/django-how-to-ensure-the-function-name-and-context-name-are-the-same-for-context-processing/comment-page-1/#comment-714</link>
		<dc:creator>Elf Sternberg</dc:creator>
		<pubDate>Thu, 17 Sep 2009 21:21:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.elfsternberg.com/?p=408#comment-714</guid>
		<description>That&#039;s true, but oddly enough, it&#039;s actually less performant.  I ran the numbers, and the inspect method is twice as efficient under cProfile.  Not that that&#039;s a good excuse for obfuscation, but it&#039;s a point in inspect&#039;s favor.</description>
		<content:encoded><![CDATA[<p>That&#8217;s true, but oddly enough, it&#8217;s actually less performant.  I ran the numbers, and the inspect method is twice as efficient under cProfile.  Not that that&#8217;s a good excuse for obfuscation, but it&#8217;s a point in inspect&#8217;s favor.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leo Shklovskii</title>
		<link>http://www.elfsternberg.com/2009/09/17/django-how-to-ensure-the-function-name-and-context-name-are-the-same-for-context-processing/comment-page-1/#comment-713</link>
		<dc:creator>Leo Shklovskii</dc:creator>
		<pubDate>Thu, 17 Sep 2009 20:43:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.elfsternberg.com/?p=408#comment-713</guid>
		<description>ugh, and the comment form killed all of my spacing... should still be pretty clear :-/</description>
		<content:encoded><![CDATA[<p>ugh, and the comment form killed all of my spacing&#8230; should still be pretty clear :-/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leo Shklovskii</title>
		<link>http://www.elfsternberg.com/2009/09/17/django-how-to-ensure-the-function-name-and-context-name-are-the-same-for-context-processing/comment-page-1/#comment-712</link>
		<dc:creator>Leo Shklovskii</dc:creator>
		<pubDate>Thu, 17 Sep 2009 20:43:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.elfsternberg.com/?p=408#comment-712</guid>
		<description>This is a nifty idea, but you can do it in a slightly less sickly clever way if you were to put it in a decorator, for example:

def same_name_in_context(fn):
    def new_func(*args):
        return { fn.func_name : fn(*args) }
    return new_func

@same_name_in_context
def need_browser_warning(request):
    return not adequate_browser(request.META.get(&#039;HTTP_USER_AGENT&#039;))</description>
		<content:encoded><![CDATA[<p>This is a nifty idea, but you can do it in a slightly less sickly clever way if you were to put it in a decorator, for example:</p>
<p>def same_name_in_context(fn):<br />
    def new_func(*args):<br />
        return { fn.func_name : fn(*args) }<br />
    return new_func</p>
<p>@same_name_in_context<br />
def need_browser_warning(request):<br />
    return not adequate_browser(request.META.get(&#8216;HTTP_USER_AGENT&#8217;))</p>
]]></content:encoded>
	</item>
</channel>
</rss>

