<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.12-alpha" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Python Gotchas</title>
	<link>http://blog.cons.org.nz/2006/09/04/python-gotchas/</link>
	<description>(cons web log)</description>
	<pubDate>Tue, 06 Jan 2009 06:27:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.12-alpha</generator>

	<item>
		<title>by: anon</title>
		<link>http://blog.cons.org.nz/2006/09/04/python-gotchas/#comment-18892</link>
		<pubDate>Mon, 11 Aug 2008 11:05:49 +0000</pubDate>
		<guid>http://blog.cons.org.nz/2006/09/04/python-gotchas/#comment-18892</guid>
					<description>1/ "print" is not an expression in python, but an instruction (you can write "print 42" (or even "print &#62;&#62; sys.stderr, 42"), whom syntax clearly shows it's not an expression), so can't be included where an expression is expected =&#62; not a gotcha (in python 3000, "print" becomes a function (thus an expression too), and the "print 42" syntax is not valid then)
2/ python, like scheme or many well-designed languages, has lexical scoping, so "base" leaks in "inc" for reading, but python doesn't like mixing scopes for a same name ; you read the more external scope OR you write it in local scope, and then it refers only to local scope =&#62; semi-gotcha</description>
		<content:encoded><![CDATA[<p>1/ &#8220;print&#8221; is not an expression in python, but an instruction (you can write &#8220;print 42&#8243; (or even &#8220;print &gt;&gt; sys.stderr, 42&#8243;), whom syntax clearly shows it&#8217;s not an expression), so can&#8217;t be included where an expression is expected =&gt; not a gotcha (in python 3000, &#8220;print&#8221; becomes a function (thus an expression too), and the &#8220;print 42&#8243; syntax is not valid then)<br />
2/ python, like scheme or many well-designed languages, has lexical scoping, so &#8220;base&#8221; leaks in &#8220;inc&#8221; for reading, but python doesn&#8217;t like mixing scopes for a same name ; you read the more external scope OR you write it in local scope, and then it refers only to local scope =&gt; semi-gotcha</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: lorne</title>
		<link>http://blog.cons.org.nz/2006/09/04/python-gotchas/#comment-4232</link>
		<pubDate>Mon, 04 Sep 2006 09:23:44 +0000</pubDate>
		<guid>http://blog.cons.org.nz/2006/09/04/python-gotchas/#comment-4232</guid>
					<description>Fixed, thank you.</description>
		<content:encoded><![CDATA[<p>Fixed, thank you.</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: qwandor</title>
		<link>http://blog.cons.org.nz/2006/09/04/python-gotchas/#comment-4231</link>
		<pubDate>Mon, 04 Sep 2006 09:20:13 +0000</pubDate>
		<guid>http://blog.cons.org.nz/2006/09/04/python-gotchas/#comment-4231</guid>
					<description>There is a typo in your links to the COMP312 and COMP304 pages.</description>
		<content:encoded><![CDATA[<p>There is a typo in your links to the COMP312 and COMP304 pages.</p>
]]></content:encoded>
				</item>
</channel>
</rss>
