<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>/var/log/tumbles &#187; comprehensions</title>
	<atom:link href="http://tumblelog.dhananjaynene.com/tag/comprehensions/feed/" rel="self" type="application/rss+xml" />
	<link>http://tumblelog.dhananjaynene.com</link>
	<description>Interesting gatherings from the web</description>
	<lastBuildDate>Mon, 13 Apr 2009 09:15:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Comprehension consistency at last in Python 3.0!</title>
		<link>http://tumblelog.dhananjaynene.com/2008/12/comprehension-consistency-in-python-3-0/</link>
		<comments>http://tumblelog.dhananjaynene.com/2008/12/comprehension-consistency-in-python-3-0/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 05:29:05 +0000</pubDate>
		<dc:creator>Dhananjay Nene</dc:creator>
				<category><![CDATA[Interesting]]></category>
		<category><![CDATA[comprehensions]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://tumblelog.dhananjaynene.com/2008/12/let%e2%80%99s-discuss-the-matter-further-%c2%bb-blog-archive-%c2%bb-comprehension-consistency-at-last-in-python-30/</guid>
		<description><![CDATA[Comprehension consistency at last in Python 3.0!. Nice example of how comprehensions in Python 3.0 seem a lot more intuitive. Earlier in Python 2.5 : Python 2.5.2 (r252:60911, Nov 14 2008, 19:46:32) [GCC 4.3.2] on linux2 Type “help”, “copyright”, “credits” or “license” for more information. &#62;&#62;&#62; &#62;&#62;&#62; dict((n, n*n) for n in range(5)) {0: 0, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rhodesmill.org/brandon/2008/comprehension-consistency-at-last-in-python-30/">Comprehension consistency at last in Python 3.0!</a>.</p>
<p>Nice example of how comprehensions in Python 3.0 seem a lot more intuitive.</p>
<p>Earlier in Python 2.5 :</p>
<blockquote>
<pre>Python 2.5.2 (r252:60911, Nov 14 2008, 19:46:32)
[GCC 4.3.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
&gt;&gt;&gt;
&gt;&gt;&gt; dict((n, n*n) for n in range(5))
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16}</pre>
</blockquote>
<p>New in Python 3.0</p>
<blockquote>
<pre>Python 3.0 (r30:67503, Dec  4 2008, 10:23:44)
[GCC 4.3.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
&gt;&gt;&gt;
&gt;&gt;&gt; [ n*n for n in range(5) ]
[0, 1, 4, 9, 16]
&gt;&gt;&gt;
&gt;&gt;&gt; { n*n for n in range(5) }
{0, 1, 4, 16, 9}
&gt;&gt;&gt;
&gt;&gt;&gt; { n: n*n for n in range(5) }
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16}</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://tumblelog.dhananjaynene.com/2008/12/comprehension-consistency-in-python-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

