[Python-Dev] PEP 340 - possible new name for block-statement (original) (raw)

Robin Munn rmunn at pobox.com
Fri Apr 29 06:28:44 CEST 2005


-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

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: | BLOCK || A variation on this with somewhat different semantics swaps the keywords: || in EXPR for VAR: | BLOCK || If you don't need the variable, you can leave the "for VAR" part out: || in EXPR: | BLOCK || 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: ~ BLOCK

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.

Robin Munn -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCcbf16OLMk9ZJcBQRAuYpAJ4n24AgsX3SrW0g7jlWJM+HfzHXMwCfTbTq eJ2mLzg1uLZv09KDUemM+WU= =SXux -----END PGP SIGNATURE-----



More information about the Python-Dev mailing list