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.

classification
Title: Functional Programming HOWTO describes one argument itertools.count()
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: Mariatta, cheryl.sabella, docs@python, rhettinger
Priority: low Keywords:

Created on 2017-06-01 11:32 by cheryl.sabella, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1919 merged cheryl.sabella, 2017-06-02 12:24
PR 1943 merged cheryl.sabella, 2017-06-04 20:18
PR 1944 merged cheryl.sabella, 2017-06-04 20:19
Messages (11)
msg294935 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2017-06-01 11:32
The Functional Programming HOWTO describes single variable itertools.count instead of the two variable version that is linked to.
msg294986 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-06-02 07:18
If you would like, go ahead an submit a PR.
msg295011 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2017-06-02 12:29
Submitted a PR, thank you.

I changed added the argument for count().  Also I noticed that the link to accumulate() was broken, so I fixed that and I added a link to functools in the references at the end of the page.

One other thing I noticed was that enumerate was described with one argument, but it takes two.  Should I update that as well?

Thanks!
msg295021 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-06-02 15:01
> enumerate was described with one argument, but it takes two.
> Should I update that as well?

Yes please.
msg295081 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2017-06-03 15:33
Thank you.  I've added that.  

This may seem like an odd question, but should I assume that the docs should always match the code?  For example, in the Functional HOWTO, I wasn't sure if the arguments were left off purposely or if it was just something that hadn't been updated.  If the docs should always match, then I wouldn't have to ask so many questions if I see another place where this happens.

Also, the example for enumerate is this:

f = open('data.txt', 'r')
for i, line in enumerate(f):
    if line.strip() == '':
        print('Blank line at line #%i' % i)

Is it code churn to replace the old style string formatting or is that something else that should be done as clean-up?
msg295111 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-06-03 23:31
> Is it code churn to replace the old style string formatting
> or is that something else that should be done as clean-up?

Let's leave it as is.  Old-style formatting is still valid and is not going away.   We consciously decided not to sweep through the docs change the string formatting style.  Also, since both occur quite a bit in the wild, it is is useful for the docs to show some of both.
msg295134 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-06-04 17:39
New changeset 9be4ff359daa67cde6246494f643ed7cd2825d46 by Raymond Hettinger (csabella) in branch 'master':
bpo-30538: Update count() in Functional Programming HOWTO (#1919)
https://github.com/python/cpython/commit/9be4ff359daa67cde6246494f643ed7cd2825d46
msg295135 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-06-04 17:39
Thank you for the PR.
msg295139 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2017-06-04 18:33
Thank you.  And thank you for explaining about the strings.  That's what I suspected, so I appreciate you confirming it.
msg295160 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-06-05 03:12
New changeset b32fb6c1fb6cdf019817176f573e60c0923a6e22 by Mariatta (csabella) in branch '3.5':
bpo-30538: Update count() in Functional Programming HOWTO (GH-1919) (GH-1944)
https://github.com/python/cpython/commit/b32fb6c1fb6cdf019817176f573e60c0923a6e22
msg295161 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-06-05 03:12
New changeset ce40550acd3a8928bb6fef4d4e73642a8a69745d by Mariatta (csabella) in branch '3.6':
bpo-30538: Update count() in Functional Programming HOWTO (GH-1919) (GH-1943)
https://github.com/python/cpython/commit/ce40550acd3a8928bb6fef4d4e73642a8a69745d
History
Date User Action Args
2022-04-11 14:58:47adminsetgithub: 74723
2017-06-05 03:12:25Mariattasetmessages: + msg295161
2017-06-05 03:12:00Mariattasetnosy: + Mariatta
messages: + msg295160
2017-06-04 20:19:35cheryl.sabellasetpull_requests: + pull_request2022
2017-06-04 20:18:34cheryl.sabellasetpull_requests: + pull_request2021
2017-06-04 18:33:55cheryl.sabellasetmessages: + msg295139
2017-06-04 17:39:53rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg295135

stage: resolved
2017-06-04 17:39:23rhettingersetmessages: + msg295134
2017-06-03 23:31:50rhettingersetmessages: + msg295111
2017-06-03 15:33:31cheryl.sabellasetmessages: + msg295081
2017-06-02 15:01:22rhettingersetmessages: + msg295021
2017-06-02 12:29:53cheryl.sabellasetmessages: + msg295011
2017-06-02 12:24:02cheryl.sabellasetpull_requests: + pull_request1998
2017-06-02 07:18:31rhettingersetpriority: normal -> low

nosy: + rhettinger
messages: + msg294986

assignee: docs@python -> rhettinger
2017-06-01 11:33:17cheryl.sabellasettype: enhancement
2017-06-01 11:32:35cheryl.sabellacreate