<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>t+1 - Latest Comments in Python niceties</title><link>http://tplus1.disqus.com/</link><description></description><atom:link href="https://tplus1.disqus.com/python_niceties/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 18 Aug 2009 00:56:29 -0000</lastBuildDate><item><title>Re: Python niceties</title><link>http://blog.tplus1.com/blog/2009/08/02/python-niceties/#comment-14997026</link><description>&lt;p&gt;Reminds me of Ruby's array literals:&lt;br&gt;   a = %w( ant bat cat dog )&lt;br&gt;After a year of Ruby I still prefer Python.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">qneill</dc:creator><pubDate>Tue, 18 Aug 2009 00:56:29 -0000</pubDate></item><item><title>Re: Python niceties</title><link>http://blog.tplus1.com/blog/2009/08/02/python-niceties/#comment-14922795</link><description>&lt;p&gt;David -- great point!  Reminds me of the qw{ } stuff available in&lt;br&gt;perl.  But much simpler.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matt Wilson</dc:creator><pubDate>Sun, 16 Aug 2009 19:17:28 -0000</pubDate></item><item><title>Re: Python niceties</title><link>http://blog.tplus1.com/blog/2009/08/02/python-niceties/#comment-14920618</link><description>&lt;p&gt;A variation on the first tip is to make a list from a string.&lt;br&gt;For example, if I want days of the week in a list, I can do:&lt;/p&gt;&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; 'monday tuesday wednesday thursday friday saturday sunday'.split()&lt;/p&gt;&lt;p&gt;It is much simple than having to type lot of quotes and comas.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David Paccoud</dc:creator><pubDate>Sun, 16 Aug 2009 17:45:10 -0000</pubDate></item><item><title>Re: Python niceties</title><link>http://blog.tplus1.com/blog/2009/08/02/python-niceties/#comment-13870917</link><description>&lt;p&gt;Thanks for the comment!&lt;/p&gt;&lt;p&gt;Yeah, I use list comprehensions and generator expressions plenty too.&lt;br&gt;In this one case, I like map just because it is so much shorter.&lt;/p&gt;&lt;p&gt;Matt&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matt Wilson</dc:creator><pubDate>Tue, 04 Aug 2009 03:25:42 -0000</pubDate></item><item><title>Re: Python niceties</title><link>http://blog.tplus1.com/blog/2009/08/02/python-niceties/#comment-13843369</link><description>&lt;p&gt;&lt;br&gt;I'd write the 2nd example using a list comrehension:&lt;/p&gt;&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; x = [1, 2, 3]&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; ', '.join([str(z) for z in x])&lt;br&gt;'1,2,3'&lt;/p&gt;&lt;p&gt;or using a generator comprehension for python 2.4 and up :&lt;/p&gt;&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; x = [1, 2, 3]&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; ', '.join(str(z) for z in x)&lt;br&gt;'1,2,3'&lt;/p&gt;&lt;p&gt;which is is more natural (at least for me ;)&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Yuce Tekol</dc:creator><pubDate>Mon, 03 Aug 2009 13:59:59 -0000</pubDate></item></channel></rss>