This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Sumudu.Fernando
Recipients Sumudu.Fernando, eric.araujo, falsetru, rhettinger, terry.reedy
Date 2012-01-18.23:13:37
SpamBayes Score 1.5250579e-12
Marked as misclassified No
Message-id <1326928418.62.0.692296920767.issue10109@psf.upfronthosting.co.za>
In-reply-to
Content
>>> tuple(itertools.cycle(enumerate(it)) for it in itertools.count())
  ...
  TypeError: 'int' object is not iterable

That is not what happens in the function, though!  That would correspond to doing product(*itertools.count(2010)), but if you try that you won't even get past argument expansion (obviously).  Doing product(*xrange(10)) gives the error you're talking about, for example.

product(itertools.count(2010)) works perfectly well with the version I posted, though it is a bit silly to do it that way since it produces the same values as count itself (which is what "cartesian product" should do), while saving extra bookkeeping along the way.

Anyway, I'm pretty new to python and I don't think this is quite relevant enough to warrant opening a new ticket.  I'm happy to leave it here for the education of the next neophyte who stumbles across this idiosyncracy of itertools.product.
History
Date User Action Args
2012-01-18 23:13:38Sumudu.Fernandosetrecipients: + Sumudu.Fernando, rhettinger, terry.reedy, falsetru, eric.araujo
2012-01-18 23:13:38Sumudu.Fernandosetmessageid: <1326928418.62.0.692296920767.issue10109@psf.upfronthosting.co.za>
2012-01-18 23:13:38Sumudu.Fernandolinkissue10109 messages
2012-01-18 23:13:37Sumudu.Fernandocreate