Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.octanews.net!indigo.octanews.net!auth.brown.octanews.com.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: Finding duplicate file names and modifying them based on elements of the path References: <7xipdkwuqd.fsf@ruckus.brouhaha.com> <14831ee0-fd74-4906-852c-764ba2d8b1d5@h20g2000yqe.googlegroups.com> <7xipdjilko.fsf@ruckus.brouhaha.com> <2862aea5-9d5c-4979-8ca2-0bb01f9db32c@m3g2000vbl.googlegroups.com> Date: Fri, 20 Jul 2012 00:51:21 -0700 Message-ID: <7xk3xyswee.fsf@ruckus.brouhaha.com> Organization: Nightsong/Fort GNOX User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:y0bJcGgATWx4/TtOqI5lA5q0KqI= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 8 NNTP-Posting-Date: 20 Jul 2012 02:51:21 CDT X-Complaints-To: abuse@octanews.net Xref: csiph.com comp.lang.python:25676 "Larry.Martell@gmail.com" writes: > It seems that if you do a list(group) you have consumed the list. This > screwed me up for a while, and seems very counter-intuitive. Yes, that is correct, you have to carefully watch where the stuff in the iterators is getting consumed, including when there are nested iterators. That's what I was mentioning earlier--it got me confused at first, but I use that style all the time now and it is pretty natural.