[Python-ideas] Nudging beginners towards a more accurate mental model for loop else clauses

Nick Coghlan ncoghlan at gmail.com
Sun Jun 10 18:04:50 CEST 2012

On Mon, Jun 11, 2012 at 1:50 AM, Yuval Greenfield <ubershmekel at gmail.com> wrote:
> I hope this isn't too off-topic, but is the tutorial supposed to
> exhaustively explain the python language?
> Because if not, then the for-else/while-else clause may be a good thing to
> move to an appendix.

It's supposed to arm people well enough to cope with at least
*reading* most code they're likely to encounter. Since for/else is the
idiomatic way to write a search loop, even beginners really should
learn how to read it. For more esoteric stuff like metaclasses where
the philosophy of "If you're wondering whether or not you need it, you
don't need it" applies, then the tutorial can safely skip it.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list