<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Python decorator mini-study (part 1 of 3)</title>
	<atom:link href="http://muharem.wordpress.com/2006/10/18/3/feed/" rel="self" type="application/rss+xml" />
	<link>http://muharem.wordpress.com/2006/10/18/3/</link>
	<description>Cool ideas revolving around computers and programming</description>
	<lastBuildDate>Tue, 15 Dec 2009 18:31:07 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: &#160;Rizwan Mansuri's Blog&#160;</title>
		<link>http://muharem.wordpress.com/2006/10/18/3/#comment-5237</link>
		<dc:creator>&#160;Rizwan Mansuri's Blog&#160;</dc:creator>
		<pubDate>Thu, 30 Jul 2009 19:11:07 +0000</pubDate>
		<guid isPermaLink="false">http://muharem.wordpress.com/2006/10/18/3/#comment-5237</guid>
		<description>[...] Python Decorator Mini-Study [...]</description>
		<content:encoded><![CDATA[<p>[...] Python Decorator Mini-Study [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kelly</title>
		<link>http://muharem.wordpress.com/2006/10/18/3/#comment-183</link>
		<dc:creator>kelly</dc:creator>
		<pubDate>Sat, 03 Feb 2007 08:28:59 +0000</pubDate>
		<guid isPermaLink="false">http://muharem.wordpress.com/2006/10/18/3/#comment-183</guid>
		<description>HI,</description>
		<content:encoded><![CDATA[<p>HI,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc</title>
		<link>http://muharem.wordpress.com/2006/10/18/3/#comment-179</link>
		<dc:creator>Marc</dc:creator>
		<pubDate>Mon, 29 Jan 2007 00:42:27 +0000</pubDate>
		<guid isPermaLink="false">http://muharem.wordpress.com/2006/10/18/3/#comment-179</guid>
		<description>Like a lot of programming issues, the merit of this particular application of decorators is largely a matter of personal/group opinion. IMHO, it&#039;s interesting but not a good idea, since it obscures what&#039;s going on and saving a few lines is not worth the loss of readibility to other programmers (remember that much of software development involves maintenance of other people&#039;s code). So as cool as it is, I&#039;d probably avoid it. It&#039;s clever, yes, too clever -:)

I think there are some other really interesting applications of decorators, such as decorators for memoization and logging the entry, parameters, and return values of functions (great for debugging!). I&#039;d bet that are interesting decorators for RPCifying functions too.</description>
		<content:encoded><![CDATA[<p>Like a lot of programming issues, the merit of this particular application of decorators is largely a matter of personal/group opinion. IMHO, it&#8217;s interesting but not a good idea, since it obscures what&#8217;s going on and saving a few lines is not worth the loss of readibility to other programmers (remember that much of software development involves maintenance of other people&#8217;s code). So as cool as it is, I&#8217;d probably avoid it. It&#8217;s clever, yes, too clever -:)</p>
<p>I think there are some other really interesting applications of decorators, such as decorators for memoization and logging the entry, parameters, and return values of functions (great for debugging!). I&#8217;d bet that are interesting decorators for RPCifying functions too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: metapundit</title>
		<link>http://muharem.wordpress.com/2006/10/18/3/#comment-20</link>
		<dc:creator>metapundit</dc:creator>
		<pubDate>Mon, 30 Oct 2006 02:43:14 +0000</pubDate>
		<guid isPermaLink="false">http://muharem.wordpress.com/2006/10/18/3/#comment-20</guid>
		<description>Re comment #2 - the self.__dict__.update(kw) method is ideal for a constructor with lots of arguments that all are being set to member variables. I still like your decorator approach better for some applications in that you don&#039;t lose the function calling signature (eg, when you accept **kw there&#039;s no way for you (or your IDE) to know just by looking at the function what arguments it takes) and you have the option of ignoring one or two arguments and setting the rest. I still value the conciseness of the decorator, even if it is only saving 3 or 4 lines of code...</description>
		<content:encoded><![CDATA[<p>Re comment #2 &#8211; the self.__dict__.update(kw) method is ideal for a constructor with lots of arguments that all are being set to member variables. I still like your decorator approach better for some applications in that you don&#8217;t lose the function calling signature (eg, when you accept **kw there&#8217;s no way for you (or your IDE) to know just by looking at the function what arguments it takes) and you have the option of ignoring one or two arguments and setting the rest. I still value the conciseness of the decorator, even if it is only saving 3 or 4 lines of code&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: import this. &#187; Blog Archive &#187; Looking at Python decorators</title>
		<link>http://muharem.wordpress.com/2006/10/18/3/#comment-19</link>
		<dc:creator>import this. &#187; Blog Archive &#187; Looking at Python decorators</dc:creator>
		<pubDate>Sun, 29 Oct 2006 00:35:53 +0000</pubDate>
		<guid isPermaLink="false">http://muharem.wordpress.com/2006/10/18/3/#comment-19</guid>
		<description>[...] Muharem Hrnjadovic talks about Python decorators. [...]</description>
		<content:encoded><![CDATA[<p>[...] Muharem Hrnjadovic talks about Python decorators. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: muharem</title>
		<link>http://muharem.wordpress.com/2006/10/18/3/#comment-9</link>
		<dc:creator>muharem</dc:creator>
		<pubDate>Fri, 20 Oct 2006 19:01:27 +0000</pubDate>
		<guid isPermaLink="false">http://muharem.wordpress.com/2006/10/18/3/#comment-9</guid>
		<description>The comment below pretty much destroys my example :-) but the one-liner at the end is so cool that I felt I had to share this with others.

From http://programming.reddit.com/info/mxcv/comments/cn1zo

This is NOT a good use for decorators. Typing few extra lines is not important because you do it only once.

If the argument list is too long, requiring too many assignments lines, use a parameter object instead.

If some automation is needed, I would use this:

def __init__(self, **kw):
&lt;blockquote&gt;    self.__dict__.update(kw)&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>The comment below pretty much destroys my example <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  but the one-liner at the end is so cool that I felt I had to share this with others.</p>
<p>From <a href="http://programming.reddit.com/info/mxcv/comments/cn1zo" rel="nofollow">http://programming.reddit.com/info/mxcv/comments/cn1zo</a></p>
<p>This is NOT a good use for decorators. Typing few extra lines is not important because you do it only once.</p>
<p>If the argument list is too long, requiring too many assignments lines, use a parameter object instead.</p>
<p>If some automation is needed, I would use this:</p>
<p>def __init__(self, **kw):</p>
<blockquote><p>    self.__dict__.update(kw)</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Plugging Python decorators &#171; Ozone</title>
		<link>http://muharem.wordpress.com/2006/10/18/3/#comment-3</link>
		<dc:creator>Plugging Python decorators &#171; Ozone</dc:creator>
		<pubDate>Fri, 20 Oct 2006 09:03:36 +0000</pubDate>
		<guid isPermaLink="false">http://muharem.wordpress.com/2006/10/18/3/#comment-3</guid>
		<description>[...] For the last few weeks, I have been having very interesting discussions with a work colleague on a wide set of topics ranging from computing to philosophy and family life. He is a smart, passionate and knowledgeable developer and an avid learner. I tried to convince him to start blogging and I am glad to see he has taken the plunge: ladies and gentlemen, give a warm welcome to Muharem Hrnjadovic! His opening salvo is a three part mini-study of Python decorators: check out part one and part two on his blog. Before you ask, part three is in the making and will be available shortly. [...]</description>
		<content:encoded><![CDATA[<p>[...] For the last few weeks, I have been having very interesting discussions with a work colleague on a wide set of topics ranging from computing to philosophy and family life. He is a smart, passionate and knowledgeable developer and an avid learner. I tried to convince him to start blogging and I am glad to see he has taken the plunge: ladies and gentlemen, give a warm welcome to Muharem Hrnjadovic! His opening salvo is a three part mini-study of Python decorators: check out part one and part two on his blog. Before you ask, part three is in the making and will be available shortly. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
