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 trey
Recipients docs@python, trey
Date 2018-03-11.18:16:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1520792191.75.0.467229070634.issue33049@psf.upfronthosting.co.za>
In-reply-to
Content
From the itertools documentation: https://docs.python.org/3/library/itertools.html?highlight=itertools#itertools.count

> Also, used with zip() to add sequence numbers.

I'm not certain what the goal of the original sentence was, but I think it's unclear as currently written.

I assume this is what's meant:

my_sequence = [1, 2, 3, 4]
for i, item in zip(count(1), my_sequence):
    print(i, item)

This is a strange thing to note though because enumerate would be a better use here.

my_sequence = [1, 2, 3, 4]
for i, item in enumerate(my_sequence, start=1):
    print(i, item)

Maybe what is meant is that count can be used with a step while enumerate cannot?

my_sequence = [1, 2, 3, 4]
for i, item in zip(count(step=5), my_sequence):
    print(i, item)

If that's the case it seems like step should instead be mentioned there instead of "sequence numbers".
History
Date User Action Args
2018-03-11 18:16:31treysetrecipients: + trey, docs@python
2018-03-11 18:16:31treysetmessageid: <1520792191.75.0.467229070634.issue33049@psf.upfronthosting.co.za>
2018-03-11 18:16:31treylinkissue33049 messages
2018-03-11 18:16:31treycreate