[issue22106] Python 2 docs 'control flow/pass' section contains bad example

Ezio Melotti report at bugs.python.org
Wed Jul 30 12:59:33 CEST 2014


Ezio Melotti added the comment:

Do you have any suggestion?
The section already includes examples about empty classes and as placeholder inside functions, and the only other "realistic" situations I can think of is inside an except to ignore errors -- but that might be considered an anti-pattern too.
It could be used with "for" loops if you want to e.g. consume an iterator, or with the "with" statement if you want to create an empty file, but these cases are not very common.

----------
nosy: +ezio.melotti

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


More information about the Python-bugs-list mailing list