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: Documentation error: itertools.dropwhile(is_even, itertools.count()) output
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.8
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: SilentGhost, docs@python, nicobao
Priority: normal Keywords:

Created on 2020-05-17 19:16 by nicobao, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg369146 - (view) Author: Nicolas Gimenez (nicobao) Date: 2020-05-17 19:16
On this page:
https://docs.python.org/3/howto/functional.html
The example:

"itertools.dropwhile(is_even, itertools.count()) =>
  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..."

is wrong. It should be:

"itertools.dropwhile(is_even, itertools.count()) =>
  1, 3, 5, 7, 9, ..."
msg369147 - (view) Author: Nicolas Gimenez (nicobao) Date: 2020-05-17 19:18
Relase: 0.32
Lang: English
Python version: 3.8.3
msg369151 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2020-05-17 19:41
Did you try running that? The documentation is correct, dropwhile works differently than filter.
History
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 84841
2020-05-17 19:41:31SilentGhostsetstatus: open -> closed

type: behavior

nosy: + SilentGhost
messages: + msg369151
resolution: not a bug
stage: resolved
2020-05-17 19:18:54nicobaosetmessages: + msg369147
2020-05-17 19:16:27nicobaocreate