<?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: Beauty in code</title>
	<atom:link href="http://www.oluyede.org/blog/2007/02/20/beauty-in-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oluyede.org/blog/2007/02/20/beauty-in-code/</link>
	<description>Everything considered harmful</description>
	<pubDate>Tue, 06 Jan 2009 02:08:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Lawrence</title>
		<link>http://www.oluyede.org/blog/2007/02/20/beauty-in-code/comment-page-1/#comment-19035</link>
		<dc:creator>Lawrence</dc:creator>
		<pubDate>Wed, 21 Feb 2007 09:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.oluyede.org/blog/2007/02/20/beauty-in-code/#comment-19035</guid>
		<description>&lt;p&gt;@Antonio: that's a nice feature indeed.&lt;/p&gt;

&lt;p&gt;@Jeff: Cool trick! I honestly don't use closures a lot but when it comes down to them they're simply powerful. The whole decoration thingy is built upon closures. I think, now that you mentioned them, the basics of Python are one of its most powerful trump cards. The builtin-types, the fact that all-is-an-object and so on simply speed up our productivity but there are cases in which Python style simply excels ;-) (That's not a comparison with other languages, don't want to start a useless flame war)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Antonio: that&#8217;s a nice feature indeed.</p>

<p>@Jeff: Cool trick! I honestly don&#8217;t use closures a lot but when it comes down to them they&#8217;re simply powerful. The whole decoration thingy is built upon closures. I think, now that you mentioned them, the basics of Python are one of its most powerful trump cards. The builtin-types, the fact that all-is-an-object and so on simply speed up our productivity but there are cases in which Python style simply excels <img src='http://www.oluyede.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> (That&#8217;s not a comparison with other languages, don&#8217;t want to start a useless flame war)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff McNeil</title>
		<link>http://www.oluyede.org/blog/2007/02/20/beauty-in-code/comment-page-1/#comment-18990</link>
		<dc:creator>Jeff McNeil</dc:creator>
		<pubDate>Wed, 21 Feb 2007 02:04:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.oluyede.org/blog/2007/02/20/beauty-in-code/#comment-18990</guid>
		<description>&lt;p&gt;I wrote an mapper class recently that interacts with an LDAP server, and I did it like so:&lt;/p&gt;

&lt;p&gt;name = property(LDAPMapper.getAttribute("cn", str))&lt;/p&gt;

&lt;p&gt;The LDAPMapper.getAttribute method was then a closure of sorts:&lt;/p&gt;

&lt;pre&gt;
def getAttribute(attr, dataType):
   def inner_get(self):
      return ldapObject.ldap_search(..attr..)
   return inner_get
&lt;/pre&gt;

&lt;p&gt;That type of thing to me really exposes the beauty of a language like Python.  Closure, first-class functions, properties, all in one system.  The best part of the whole equation? I can easily subclass LDAPMapper as an account object or something of the sort and retrieve an LDAP name simply by accessing the 'name' parameter.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I wrote an mapper class recently that interacts with an LDAP server, and I did it like so:</p>

<p>name = property(LDAPMapper.getAttribute(&#8221;cn&#8221;, str))</p>

<p>The LDAPMapper.getAttribute method was then a closure of sorts:</p>

<pre>
def getAttribute(attr, dataType):
   def inner_get(self):
      return ldapObject.ldap_search(..attr..)
   return inner_get
</pre>

<p>That type of thing to me really exposes the beauty of a language like Python.  Closure, first-class functions, properties, all in one system.  The best part of the whole equation? I can easily subclass LDAPMapper as an account object or something of the sort and retrieve an LDAP name simply by accessing the &#8216;name&#8217; parameter.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Antonio Cavedoni</title>
		<link>http://www.oluyede.org/blog/2007/02/20/beauty-in-code/comment-page-1/#comment-18934</link>
		<dc:creator>Antonio Cavedoni</dc:creator>
		<pubDate>Tue, 20 Feb 2007 16:31:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.oluyede.org/blog/2007/02/20/beauty-in-code/#comment-18934</guid>
		<description>&lt;p&gt;I must say I’m quite fond of list comprehensions myself, although my vote goes to a little-known feature of Python’s unicode implementation; you can actually call unicode codepoints by name, thus: u"N{INTERROBANG}".&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I must say I’m quite fond of list comprehensions myself, although my vote goes to a little-known feature of Python’s unicode implementation; you can actually call unicode codepoints by name, thus: u&#8221;N{INTERROBANG}&#8221;.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: C8E</title>
		<link>http://www.oluyede.org/blog/2007/02/20/beauty-in-code/comment-page-1/#comment-18913</link>
		<dc:creator>C8E</dc:creator>
		<pubDate>Tue, 20 Feb 2007 13:37:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.oluyede.org/blog/2007/02/20/beauty-in-code/#comment-18913</guid>
		<description>&lt;blockquote&gt;
  &lt;/blockquote&gt;

&lt;blockquote&gt;
    &lt;/blockquote&gt;

&lt;blockquote&gt;
      &lt;p&gt;from &lt;strong&gt;future&lt;/strong&gt; import braces&lt;/p&gt;
    &lt;/blockquote&gt;
</description>
		<content:encoded><![CDATA[<blockquote>
  </blockquote>

<blockquote>
    </blockquote>

<blockquote>
      <p>from <strong>future</strong> import braces</p>
    </blockquote>]]></content:encoded>
	</item>
	<item>
		<title>By: deelan</title>
		<link>http://www.oluyede.org/blog/2007/02/20/beauty-in-code/comment-page-1/#comment-18903</link>
		<dc:creator>deelan</dc:creator>
		<pubDate>Tue, 20 Feb 2007 12:53:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.oluyede.org/blog/2007/02/20/beauty-in-code/#comment-18903</guid>
		<description>&lt;p&gt;This is a oneliner I wrote time ago to extract the most recent datetime given a list of stories and their published datetime.&lt;/p&gt;

&lt;p&gt;date_last_updated = max([story.date_published for story in stories])&lt;/p&gt;

&lt;p&gt;date_last_updated is then used to populate the updated field of a Atom feed.&lt;/p&gt;

&lt;p&gt;Now that I think about it, this could be improved to use a generation expression when used with a recent version of Python.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is a oneliner I wrote time ago to extract the most recent datetime given a list of stories and their published datetime.</p>

<p>date_last_updated = max([story.date_published for story in stories])</p>

<p>date_last_updated is then used to populate the updated field of a Atom feed.</p>

<p>Now that I think about it, this could be improved to use a generation expression when used with a recent version of Python.</p>]]></content:encoded>
	</item>
</channel>
</rss>
