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

2014-07-30 Thread Ezio Melotti
Changes by Ezio Melotti : -- stage: -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

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

2014-07-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry Charles, this is a non-issue. The section does a great job communicating what "pass" does. It has been in the docs since 2007 and no harm has come of it. -- nosy: +rhettinger resolution: -> not a bug status: open -> closed

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

2014-07-30 Thread Ezio Melotti
Ezio Melotti added the comment: Keep in mind that this is in one of the first sections of the tutorial, where try/except, with, and generators have not been introduced yet. Maybe the comment could be changed to a simpler "loop forever (use ctrl+c to stop)" so that it doesn't suggest that this i

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

2014-07-30 Thread Charles Newey
Charles Newey added the comment: @David I have no idea either (no having written much of that sort of code myself either), but that looks more sensible. I'm just nitpicking really, anyway. -- ___ Python tracker _

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

2014-07-30 Thread R. David Murray
R. David Murray added the comment: How about something like: for x in my_generator(): pass # Exhaust co-routine generator to make sure all data is processed. I have no idea if you'd ever actually do that in a well-structured co-routine context, though, not having written very much

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

2014-07-30 Thread Charles Newey
Charles Newey added the comment: Your point about using "pass" with the "with" statement sounds like a better example than using "pass" in a loop. Perhaps even something like adding a note to the example to clarify it: """ # Don't use this in Python code - it is for illustrative purposes only w

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

2014-07-30 Thread Ezio Melotti
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-patte

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

2014-07-30 Thread Charles Newey
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: ...