Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.029 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'url:pipermail': 0.05; 'nested': 0.07; 'cc:addr:python-list': 0.11; '-tkc': 0.16; 'arent': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'subject:skip:m 10': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'tried': 0.27; 'code': 0.31; 'supposed': 0.32; 'url:python': 0.33; 'ago': 0.33; 'something': 0.35; 'there': 0.35; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'url:mail': 0.40; 'making': 0.63; 'to:addr:gmail.com': 0.65; 'believe': 0.68; 'existence.': 0.84; 'received:50.22': 0.84; 'subject:space': 0.84 Date: Wed, 6 Aug 2014 06:39:23 -0500 From: Tim Chase To: Gayathri J Subject: Re: Pythonic way to iterate through multidimensional space? In-Reply-To: References: X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: authenticated_id: tim@thechases.com Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 1407329943 news.xs4all.nl 2829 [2001:888:2000:d::a6]:53306 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75800 On 2014-08-06 11:04, Gayathri J wrote: > Below is the code I tried to check if itertools.product() was > faster than normal nested loops... > > they arent! arent they supposed to be...or am i making a mistake? I believe something like this was discussed a while ago and there was a faster-but-uglier solution so you might want to consult this thread: https://mail.python.org/pipermail/python-list/2008-January/516109.html I believe this may have taken place before itertools.product() came into existence. -tkc