J
Jp Calderone
What are you talking about? There's tons of new "magical syntax" in
Python. Examples for "magical syntax" features that don't work on
1.5.2 include:
*List comprehensions
Yep.
*String methods
Nope. The syntax is identical. Strings just happen to have more useful
attributes new.
*Generators
Yep.
*Emulating numeric types
Nope. Never seen __coerce__?
*Nested scopes
Hmm. Not really a syntactic difference... The syntax is the same, after
all, but the behavior is definitely different.
* * and ** in function declarations
Yep.
*for line in this_file
Nope. Same as with strings, the iterator protocol, a set of methods with
a defined meaning, was added, and file objects were made to implement it.
No syntactic changes.
*Subclassing types
This is another iffy one. The syntax is no different, the behavior has
just been changed. "str", "int", etc, used to be builtin functions, not
type objects. You also couldn't subclass types in Python, but if you could
have, the syntax would have been identical to what it is today.
There's tons of stuff still being added to Python.
Definitely. But "stuff" isn't always the same as "magical syntax".
Jp