[New-bugs-announce] [issue22106] Python 2 docs 'control flow/pass' section contains bad example

Charles Newey report at bugs.python.org
Wed Jul 30 12:47:09 CEST 2014


New submission from Charles Newey:

URL: https://docs.python.org/2/tutorial/controlflow.html#pass-statements

Quoted verbatim:
"""
The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example:
>>>

>>> while True:
...     pass  # Busy-wait for keyboard interrupt (Ctrl+C)
...

"""

While the example illustrates the point, it *may* give bad ideas to novice programmers reading it - "while True: pass" is an antipattern as it's very inefficient.

----------
assignee: docs at python
components: Documentation
messages: 224296
nosy: Charles.Newey, docs at python
priority: normal
severity: normal
status: open
title: Python 2 docs 'control flow/pass' section contains bad example
type: enhancement
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22106>
_______________________________________


More information about the New-bugs-announce mailing list