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 rhettinger
Recipients docs@python, rhettinger, serhiy.storchaka, trey
Date 2018-03-12.05:07:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1520831255.74.0.467229070634.issue33049@psf.upfronthosting.co.za>
In-reply-to
Content
> This is a strange thing to note though because enumerate 
> would be a better use here.

IIRC, the wording predates the addition of enumerate() and before enumerate() grew a *start* argument.  That said, enumerate() just addresses care the most common case.  It is still worth mentioning that count() is still useful for the general case of adding sequence numbers to data streams woven together by zip() -- like the way auto-increment is used in SQL:

    from time import ctime

    def timestamp():
        while True:
            yield ctime()
           
    def user_request():
        while True:
            yield input()
     
    logged_requests = zip(user_request(), count(1), timestamp(), cycle(available_servers))

> it seems like step should instead be mentioned there
> instead of "sequence numbers".

The *step* argument was a late addition to the API and isn't used much in practice.  When it is used, its meaning and use case tend to be self-evident (i.e. counting 60 seconds at a time, or counting backwards), so it doesn't warrant further elaboration.

The sentence as-is is imperfect (it makes you wonder why not just use enumerate) but it seems better than either saying less by not mentioning the use case or getting too wordy which would place too much emphasis on use cases less common that those served by enumerate().  So, my preference is to leave the sentence as it stands.  The intent of the two sentences mentioning map() and zip() was to hint at the possibilities while still keeping the paragraph primary focused on what count() actually does.
History
Date User Action Args
2018-03-12 05:07:35rhettingersetrecipients: + rhettinger, docs@python, serhiy.storchaka, trey
2018-03-12 05:07:35rhettingersetmessageid: <1520831255.74.0.467229070634.issue33049@psf.upfronthosting.co.za>
2018-03-12 05:07:35rhettingerlinkissue33049 messages
2018-03-12 05:07:34rhettingercreate