<?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: A pythonic n-wise iterator for any iterable</title>
	<atom:link href="http://blog.mahmoudimus.com/2010/06/a-pythonic-n-wise-iterator-for-any-iterable/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mahmoudimus.com/2010/06/a-pythonic-n-wise-iterator-for-any-iterable/</link>
	<description>a hacker&#039;s moleskine</description>
	<lastBuildDate>Sat, 24 Dec 2011 00:13:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: John Hamilton</title>
		<link>http://blog.mahmoudimus.com/2010/06/a-pythonic-n-wise-iterator-for-any-iterable/#comment-40</link>
		<dc:creator>John Hamilton</dc:creator>
		<pubDate>Wed, 16 Jun 2010 20:07:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mahmoudimus.com/?p=99#comment-40</guid>
		<description>The itertools module is one of my favorites.  Here is another way to write your function n_wise.

[python]
from itertools import islice, izip, tee

def n_wise(iterable, n):
    n_iterators = tee(iterable, n)
    zippables = (islice(it, j, None) for j, it in enumerate(n_iterators))
    return izip(*zippables)

[/python]</description>
		<content:encoded><![CDATA[<p>The itertools module is one of my favorites.  Here is another way to write your function n_wise.</p>
<pre class="brush: python; title: ;">
from itertools import islice, izip, tee

def n_wise(iterable, n):
    n_iterators = tee(iterable, n)
    zippables = (islice(it, j, None) for j, it in enumerate(n_iterators))
    return izip(*zippables)
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Hamilton</title>
		<link>http://blog.mahmoudimus.com/2010/06/a-pythonic-n-wise-iterator-for-any-iterable/#comment-56</link>
		<dc:creator>John Hamilton</dc:creator>
		<pubDate>Wed, 16 Jun 2010 20:07:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mahmoudimus.com/?p=99#comment-56</guid>
		<description>The itertools module is one of my favorites.  Here is another way to write your function n_wise.

[python]
from itertools import islice, izip, tee

def n_wise(iterable, n):
    n_iterators = tee(iterable, n)
    zippables = (islice(it, j, None) for j, it in enumerate(n_iterators))
    return izip(*zippables)

[/python]</description>
		<content:encoded><![CDATA[<p>The itertools module is one of my favorites.  Here is another way to write your function n_wise.</p>
<pre class="brush: python; title: ;">
from itertools import islice, izip, tee

def n_wise(iterable, n):
    n_iterators = tee(iterable, n)
    zippables = (islice(it, j, None) for j, it in enumerate(n_iterators))
    return izip(*zippables)
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

