Am I the only one who would love these extentions? - Python 3.0 proposals (long)

KefX keflimarcusx at aol.comNOSPAM
Mon Nov 10 06:59:15 EST 2003


>But I forget a colon for
>each 'else' and I feel that I'm not the only one.

Funny...I always remember it on the 'else' statement and forget it on the 'if'
statement. ;)

Yet, I'm in favor of leaving the colon there. All you have to do to make sure
that your module is syntactically correct, in case you're worried about it, is
try to import it (it doesn't have to be in the context of your program). The
colon also helps programs such as text editors, code processing tools, and such
figure out where blocks begin: all blocks begin with a colon. Think of it as an
opening brace, or a 'begin' statement, and nobody has to argue over where it
belongs. ;) You'll get used to it in time and I don't think it really hurts
anything. And I do think it makes code a little more readable, by saying "Hey!
A block begins here!", which is why the colon was put into the language in the
first place.

As for the rest of your suggestions, well, from what I've heard, half of the
issues have been beaten to death, and some of the rest seem silly. Why make
"True" a keyword when it's fine as it is?

There's no ?: operator because nobody can agree on its syntax, and most of the
people who commented on the matter said that if they couldn't have their way,
they wouldn't have it at all, so nobody has it. When the primary idea in a PEP
is rejected, it has almost zero chance of ever resurfacing.

regexps aren't built into the language because, for one thing, they really
aren't pretty. Most Python code, assuming a competent programmer, is pretty.
You wouldn't want to ruin that prettiness by making a non-pretty feature too
tempting, would you? ;) Of course, you still have regexps when you need them,
so what does it cost you?

And so on. I don't think your ideas are the worst things I've ever heard or
anything, but I have to say that you might be better served in trying to figure
out why it is the way it is, rather than thinking "I don't like this, what can
I do to change it?"...and if you can't figure it out for yourself, you can
always ask here. :)

- Kef





More information about the Python-list mailing list