<?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: Various Small Python Helpers</title>
	<atom:link href="http://www.algorithm.co.il/blogs/programming/python/various-small-python-helpers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.algorithm.co.il/blogs/programming/various-small-python-helpers/</link>
	<description>Algorithms, for the heck of it</description>
	<lastBuildDate>Tue, 21 Jun 2011 21:07:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: Aldrin Martoq - Technical Weblog &#187; Blog Archive &#187; The quest for the perfect python enum/constant declaration, Part 2</title>
		<link>http://www.algorithm.co.il/blogs/programming/various-small-python-helpers/#comment-105</link>
		<dc:creator>Aldrin Martoq - Technical Weblog &#187; Blog Archive &#187; The quest for the perfect python enum/constant declaration, Part 2</dc:creator>
		<pubDate>Tue, 23 Dec 2008 01:02:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.algorithm.co.il/blogs/index.php/programming/python/various-small-python-helpers/#comment-105</guid>
		<description>[...] language. One hint for this is the many enum-like solutions you can find around the net. Some are simple and clean, but none provides all the features I [...]</description>
		<content:encoded><![CDATA[<p>[...] language. One hint for this is the many enum-like solutions you can find around the net. Some are simple and clean, but none provides all the features I [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lorg</title>
		<link>http://www.algorithm.co.il/blogs/programming/various-small-python-helpers/#comment-104</link>
		<dc:creator>lorg</dc:creator>
		<pubDate>Fri, 14 Mar 2008 12:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.algorithm.co.il/blogs/index.php/programming/python/various-small-python-helpers/#comment-104</guid>
		<description>1. You are correct. Using %x is more elegant, and will work in Python 3.
2. You are correct on this one as well. In fact, my implementation of head might cause a potential bug. This is because zip (and izip) leave long iterators in an uncertain state, by taking more elements than they should.</description>
		<content:encoded><![CDATA[<p>1. You are correct. Using %x is more elegant, and will work in Python 3.<br />
2. You are correct on this one as well. In fact, my implementation of head might cause a potential bug. This is because zip (and izip) leave long iterators in an uncertain state, by taking more elements than they should.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erez</title>
		<link>http://www.algorithm.co.il/blogs/programming/various-small-python-helpers/#comment-103</link>
		<dc:creator>Erez</dc:creator>
		<pubDate>Thu, 13 Mar 2008 18:05:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.algorithm.co.il/blogs/index.php/programming/python/various-small-python-helpers/#comment-103</guid>
		<description>Hi, two suggestions:
1) Replace hex(self)[2:-1] with &#039;%x&#039;%self. It&#039;s prettier.
Also, the &#039;L&#039; postfix gets abandoned in Python 3.0 .

2) Your &#039;head&#039; function is just a special case of &#039;itertools.islice&#039; .</description>
		<content:encoded><![CDATA[<p>Hi, two suggestions:<br />
1) Replace hex(self)[2:-1] with &#8216;%x&#8217;%self. It&#8217;s prettier.<br />
Also, the &#8216;L&#8217; postfix gets abandoned in Python 3.0 .</p>
<p>2) Your &#8216;head&#8217; function is just a special case of &#8216;itertools.islice&#8217; .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lorg</title>
		<link>http://www.algorithm.co.il/blogs/programming/various-small-python-helpers/#comment-102</link>
		<dc:creator>lorg</dc:creator>
		<pubDate>Sun, 09 Mar 2008 22:53:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.algorithm.co.il/blogs/index.php/programming/python/various-small-python-helpers/#comment-102</guid>
		<description>Yoni: You misunderstood my intent. Head takes the first num_items from iterable.
I&#039;m piggy-backing on zip&#039;s behavior. zip always takes the shorter of the input sequences.
It also works for infinite sequences (such as itertools.count()).

Maybe I should have used itertools.izip instead though, to avoid generating the num_items of iterable at once.

And thanks!</description>
		<content:encoded><![CDATA[<p>Yoni: You misunderstood my intent. Head takes the first num_items from iterable.<br />
I&#8217;m piggy-backing on zip&#8217;s behavior. zip always takes the shorter of the input sequences.<br />
It also works for infinite sequences (such as itertools.count()).</p>
<p>Maybe I should have used itertools.izip instead though, to avoid generating the num_items of iterable at once.</p>
<p>And thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yoni</title>
		<link>http://www.algorithm.co.il/blogs/programming/various-small-python-helpers/#comment-101</link>
		<dc:creator>Yoni</dc:creator>
		<pubDate>Sun, 09 Mar 2008 22:16:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.algorithm.co.il/blogs/index.php/programming/python/various-small-python-helpers/#comment-101</guid>
		<description>Neat @ first two.

The last one isn&#039;t missing (unless I misunderstood your intent): &quot;enumerate&quot; is a built-in since Python 2.4, I believe.</description>
		<content:encoded><![CDATA[<p>Neat @ first two.</p>
<p>The last one isn&#8217;t missing (unless I misunderstood your intent): &#8220;enumerate&#8221; is a built-in since Python 2.4, I believe.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

