Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'url:py': 0.07; 'python': 0.08; 'context:': 0.09; 'algorithm': 0.13; 'circumvented': 0.16; 'message-id:@talk.nabble.com': 0.16; 'nabble.com.': 0.16; 'received:192.168.236': 0.16; 'received:192.168.236.156': 0.16; 'received:216.139': 0.16; 'received:216.139.236': 0.16; 'received:isper.nabble.com': 0.16; 'received:nabble.com': 0.16; 'url:nabble': 0.16; 'url:old': 0.16; 'subject:list': 0.18; "haven't": 0.20; 'header:In-Reply-To:1': 0.22; 'archive': 0.23; 'module,': 0.23; 'worked': 0.23; 'attached.': 0.24; "python's": 0.24; 'code': 0.25; 'skip:b 20': 0.26; '(this': 0.28; 'problem': 0.28; 'list': 0.32; 'this.': 0.32; 'yet': 0.32; 'to:addr:python- list': 0.33; "i've": 0.34; 'list.': 0.35; 'charset:us-ascii': 0.36; 'but': 0.37; 'subject:can': 0.38; 'returning': 0.38; 'subject:: ': 0.39; 'received:192': 0.39; 'suggestions': 0.39; 'appreciated.': 0.39; 'to:addr:python.org': 0.39; 'mailing': 0.39; "i'd": 0.40; 'subject:from': 0.40; 'contact': 0.66; 'view': 0.67; 'boxes.': 0.84; 'numbered': 0.84 Date: Sat, 10 Sep 2011 12:57:21 -0700 (PDT) From: "Dr. Phillip M. Feldman" To: python-list@python.org Subject: Re: can't generate iterator from list In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: Phillip.M.Feldman@gmail.com References: <32435519.post@talk.nabble.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1315684643 news.xs4all.nl 2509 [2001:888:2000:d::a6]:50444 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:13080 Very nice explanation! I've circumvented the problem by returning a `deepcopy` of the list. I've also added an acknowledgment. The revised code is attached. I'd like to see both balls in numbered boxes (this code) and balls in unnumbered (indistinguishable) boxes in Python's `itertools` module, but don't know whom to contact about this. Also, I haven't yet worked out a good algorithm for balls in unnumbered boxes. Any suggestions will be appreciated. Phillip http://old.nabble.com/file/p32439307/balls_in_numbered_boxes.py balls_in_numbered_boxes.py -- View this message in context: http://old.nabble.com/can%27t-generate-iterator-from-list-tp32435519p32439307.html Sent from the Python - python-list mailing list archive at Nabble.com.