<?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: Python impressions</title>
	<atom:link href="http://eli.thegreenplace.net/2008/06/06/python-impressions/feed/" rel="self" type="application/rss+xml" />
	<link>http://eli.thegreenplace.net/2008/06/06/python-impressions/</link>
	<description>Eli Bendersky's personal website</description>
	<lastBuildDate>Wed, 10 Mar 2010 17:32:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: mikrobitti tarjous</title>
		<link>http://eli.thegreenplace.net/2008/06/06/python-impressions/comment-page-1/#comment-191545</link>
		<dc:creator>mikrobitti tarjous</dc:creator>
		<pubDate>Sun, 09 Aug 2009 13:09:30 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/06/06/python-impressions/#comment-191545</guid>
		<description>Python is just one language that I just don&#039;t get at all. You guys seems like gurus to me :)</description>
		<content:encoded><![CDATA[<p>Python is just one language that I just don&#8217;t get at all. You guys seems like gurus to me <img src='http://eli.thegreenplace.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seun Osewa</title>
		<link>http://eli.thegreenplace.net/2008/06/06/python-impressions/comment-page-1/#comment-145433</link>
		<dc:creator>Seun Osewa</dc:creator>
		<pubDate>Sat, 13 Dec 2008 12:39:10 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/06/06/python-impressions/#comment-145433</guid>
		<description>`&lt;code&gt;__abENT__quot;, __abENT__quot;__abENT__#46;join(str(i) for i in [1,2,3])&lt;/code&gt;`</description>
		<content:encoded><![CDATA[<div class="backtick"><pre><code>&quot;, &quot;&#46;join(str(i) for i in [1,2,3])</code></pre></div>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://eli.thegreenplace.net/2008/06/06/python-impressions/comment-page-1/#comment-122510</link>
		<dc:creator>William</dc:creator>
		<pubDate>Mon, 16 Jun 2008 00:39:51 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/06/06/python-impressions/#comment-122510</guid>
		<description>&#039;, &#039;.join(map(str, [1, 2, 3]))

is cuter still :)</description>
		<content:encoded><![CDATA[<p>&#8216;, &#8216;.join(map(str, [1, 2, 3]))</p>
<p>is cuter still <img src='http://eli.thegreenplace.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antonio Ognio</title>
		<link>http://eli.thegreenplace.net/2008/06/06/python-impressions/comment-page-1/#comment-122213</link>
		<dc:creator>Antonio Ognio</dc:creator>
		<pubDate>Sat, 07 Jun 2008 20:05:32 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/06/06/python-impressions/#comment-122213</guid>
		<description>This does not work:

&gt;&gt;&gt; &#039;, &#039;.join([1, 2, 3])
Traceback (most recent call last):
  File &quot;&quot;, line 1, in 
TypeError: sequence item 0: expected string, int found

This works:

&gt;&gt;&gt; &#039;, &#039;.join( [&#039;%d&#039; % num for num in [1, 2, 3] ] )
&#039;1, 2, 3&#039;

In tha latter case you&#039;re joining a list of string elements that have been created using a list comprehension thus the join works.

Regards,

Antonio
Lima - Peru</description>
		<content:encoded><![CDATA[<p>This does not work:</p>
<p>&gt;&gt;&gt; &#8216;, &#8216;.join([1, 2, 3])<br />
Traceback (most recent call last):<br />
  File &#8220;&#8221;, line 1, in<br />
TypeError: sequence item 0: expected string, int found</p>
<p>This works:</p>
<p>&gt;&gt;&gt; &#8216;, &#8216;.join( ['%d' % num for num in [1, 2, 3] ] )<br />
&#8216;1, 2, 3&#8242;</p>
<p>In tha latter case you&#8217;re joining a list of string elements that have been created using a list comprehension thus the join works.</p>
<p>Regards,</p>
<p>Antonio<br />
Lima &#8211; Peru</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eliben</title>
		<link>http://eli.thegreenplace.net/2008/06/06/python-impressions/comment-page-1/#comment-122163</link>
		<dc:creator>eliben</dc:creator>
		<pubDate>Fri, 06 Jun 2008 19:49:25 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/06/06/python-impressions/#comment-122163</guid>
		<description>Yoav: are you working ? are they using Linux at work ? If so, lucky you.

ripper: yeah, actually Ruby has this feature too. I think it&#039;s a bit confusing, because when you see code you thought you know its workings, it may surprise you because someone redefined the way some built-in class works.

njharman: private methods have their uses, in Python too. And I see a lot of Python code (stdlib included) with them.</description>
		<content:encoded><![CDATA[<p>Yoav: are you working ? are they using Linux at work ? If so, lucky you.</p>
<p>ripper: yeah, actually Ruby has this feature too. I think it&#8217;s a bit confusing, because when you see code you thought you know its workings, it may surprise you because someone redefined the way some built-in class works.</p>
<p>njharman: private methods have their uses, in Python too. And I see a lot of Python code (stdlib included) with them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Name</title>
		<link>http://eli.thegreenplace.net/2008/06/06/python-impressions/comment-page-1/#comment-122162</link>
		<dc:creator>Name</dc:creator>
		<pubDate>Fri, 06 Jun 2008 19:37:12 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/06/06/python-impressions/#comment-122162</guid>
		<description>“Name: how do you write a 1-tuple ? isn’t that ugly ?
Whatever works for if, can work for unless too. It will make code more readable.
Can you elaborate on abstract classes that will solve the ‘join’ issue ?”

I write all tuples wrapped in parens, because it makes it easier for the human reader to distinguish them from function parameters. I also use trailing commas, because in multi-line tuples trailing commas reduce noise in diffs. However, the computer does not care; it would be equally as happy with any style:

a = 1,
a = (1,)
b = 1, 2, 3
b = 1, 2, 3,
b = (1, 2, 3,)

————————

Abstract base classes can provide default implementations of methods. For example, the sequence ABC can simply define a method join():

def join (self, sep):
  return sep.join (self)

and let [1, 2, 3].join (&#039;,&#039;) work the same as &#039;,&#039;.join ([1, 2, 3]).</description>
		<content:encoded><![CDATA[<p>“Name: how do you write a 1-tuple ? isn’t that ugly ?<br />
Whatever works for if, can work for unless too. It will make code more readable.<br />
Can you elaborate on abstract classes that will solve the ‘join’ issue ?”</p>
<p>I write all tuples wrapped in parens, because it makes it easier for the human reader to distinguish them from function parameters. I also use trailing commas, because in multi-line tuples trailing commas reduce noise in diffs. However, the computer does not care; it would be equally as happy with any style:</p>
<p>a = 1,<br />
a = (1,)<br />
b = 1, 2, 3<br />
b = 1, 2, 3,<br />
b = (1, 2, 3,)</p>
<p>————————</p>
<p>Abstract base classes can provide default implementations of methods. For example, the sequence ABC can simply define a method join():</p>
<p>def join (self, sep):<br />
  return sep.join (self)</p>
<p>and let [1, 2, 3].join (&#8216;,&#8217;) work the same as &#8216;,&#8217;.join ([1, 2, 3]).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ripper234</title>
		<link>http://eli.thegreenplace.net/2008/06/06/python-impressions/comment-page-1/#comment-122161</link>
		<dc:creator>ripper234</dc:creator>
		<pubDate>Fri, 06 Jun 2008 19:27:45 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/06/06/python-impressions/#comment-122161</guid>
		<description>&quot;len is a function and not a method&quot;...

Sorry to introduce on this Python discussion, but I would just like to point out that C# 3.0 have this attractive feature - it allows one to add methods to existing classes.

Not happy with the the List class doesn&#039;t have join()? Write
string Join(List this, string seperator)
{
 return seperator.Join(this);
}

Back to watching Babylon 5 now, and again sorry if it&#039;s too off-topic.</description>
		<content:encoded><![CDATA[<p>&#8220;len is a function and not a method&#8221;&#8230;</p>
<p>Sorry to introduce on this Python discussion, but I would just like to point out that C# 3.0 have this attractive feature &#8211; it allows one to add methods to existing classes.</p>
<p>Not happy with the the List class doesn&#8217;t have join()? Write<br />
string Join(List this, string seperator)<br />
{<br />
 return seperator.Join(this);<br />
}</p>
<p>Back to watching Babylon 5 now, and again sorry if it&#8217;s too off-topic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: njharman</title>
		<link>http://eli.thegreenplace.net/2008/06/06/python-impressions/comment-page-1/#comment-122159</link>
		<dc:creator>njharman</dc:creator>
		<pubDate>Fri, 06 Jun 2008 18:51:56 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/06/06/python-impressions/#comment-122159</guid>
		<description>Private methods are like curly brackets, getters setters and other OO purist cruft.  You soon realize they add little but more typing.  Other than __special__ methods I&#039;ve not used private methods in a very very long time.  I almost never see them in mature Python code.  

Don&#039;t use them.</description>
		<content:encoded><![CDATA[<p>Private methods are like curly brackets, getters setters and other OO purist cruft.  You soon realize they add little but more typing.  Other than __special__ methods I&#8217;ve not used private methods in a very very long time.  I almost never see them in mature Python code.  </p>
<p>Don&#8217;t use them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: יואב</title>
		<link>http://eli.thegreenplace.net/2008/06/06/python-impressions/comment-page-1/#comment-122156</link>
		<dc:creator>יואב</dc:creator>
		<pubDate>Fri, 06 Jun 2008 18:25:17 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/06/06/python-impressions/#comment-122156</guid>
		<description>מי מכריח אותך לעבוד בוינדוס ? תעבוד בלינוקס. פייתון מותקן בברירת מחדל ברוב הפצות הלינוקס.</description>
		<content:encoded><![CDATA[<p>מי מכריח אותך לעבוד בוינדוס ? תעבוד בלינוקס. פייתון מותקן בברירת מחדל ברוב הפצות הלינוקס.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Larry Clapp</title>
		<link>http://eli.thegreenplace.net/2008/06/06/python-impressions/comment-page-1/#comment-122155</link>
		<dc:creator>Larry Clapp</dc:creator>
		<pubDate>Fri, 06 Jun 2008 18:05:57 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/06/06/python-impressions/#comment-122155</guid>
		<description>Interesting that roughly half of what you like is the language itself, and half the community and whatnot, whereas all of what you don&#039;t like is the language.  Not bad or good, just interesting.</description>
		<content:encoded><![CDATA[<p>Interesting that roughly half of what you like is the language itself, and half the community and whatnot, whereas all of what you don&#8217;t like is the language.  Not bad or good, just interesting.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
