[Python-Dev] PEP 340 - possible new name for block-statement
rmunn at pobox.com
Fri Apr 29 06:28:44 CEST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Guido van Rossum wrote:
| How about, instead of trying to emphasize how different a
| block-statement is from a for-loop, we emphasize their similarity?
| A regular old loop over a sequence or iterable is written as:
| for VAR in EXPR:
| A variation on this with somewhat different semantics swaps the keywords:
| in EXPR for VAR:
| If you don't need the variable, you can leave the "for VAR" part out:
| in EXPR:
| Too cute? :-)
Far too close to the "for" loop, IMHO. I read that, I'd have to remind
myself every time, "now, which one is it that can receive values passed
back in: for ... in, or in ... for?"
I'm definitely -1 on that one: too confusing.
Another possibility just occurred to me. How about "using"?
~ using EXPR as VAR:
Reads similarly to "with", but leaves the "with" keyword open for
possible use later.
Since it seems traditional for one to introduce oneself upon first
posting to python-dev, my name is Robin Munn. Yes, my name is just one
letter different from Robin Dunn's. It's not like I *intended* to cause
confusion... :-) Anyway, I was introduced to Python a few years ago,
around version 2.1 or so, and fell in love with the fact that I could
read my own code six months later and understand it. I try to help out
where I can, but I don't know the guts of the interpreter, so on
python-dev I mostly lurk.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the Python-Dev