[Python-Dev] Pep 318 - new syntax (esp for wrappers) (original) (raw)
Bob Ippolito bob at redivi.com
Wed Mar 3 14:59:26 EST 2004
- Previous message: [Python-Dev] Pep 318 - new syntax (esp for wrappers)
- Next message: [Python-Dev] importing from files with currently invalid names
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mar 3, 2004, at 2:39 PM, Jewett, Jim J wrote:
Bob Ippolito
ANYTHING that transforms a function in ANY way can be represented by this decorator syntax. "can" != "should".
Eh. "can" doesn't IMPLY "should", but that doesn't mean they're always inequal. In other words, I can't think of an explicit-function-transform that I would want to represent in a different way, unless I wanted a copy of the original hanging around.
The transforms can be represented in the current syntax, but we agree that the current idiom should be improved. Different changes may be preferable for other patterns.
Like what?
(2) Wrappers are not essential to understanding functions, and should not pretend to be. ...
In most languages, classifiers are always relevant. {int, public, synchronized, ...} [In python, these wrappers] are not essential to understanding how to make your own functions or methods, exactly. Since when do newbies read the "language lawyer" documentation? Depends on the newbie, and the definition of "language lawyer".
from http://www.python.org/doc/2.3.3/
Language Reference
(for language lawyers)
It's a 'little' dense for a newbie.
Most programmers want a manual or reference when they're first learning, and will turn to it when they get confused. (Hey, I got a syntax error! What's up? Hey, this function just changed its signature!) Then they'll see the full syntax.
And they'll also see that they haven't needed it yet, and it's presumably not in the beginner tutorials, so they don't need to learn it just yet. I don't see how it's any different than say, using radd, the yield keyword, the exec statement, or some of the more advanced exception handling constructs. From what I've seen, beginners don't really even notice that these things exist, and that's good. I don't see extended function syntax being any different.
No tutorials or existing code ... use this syntax yet, so newbies are obviously not going to see it. There will always be more newbies -- even a year after this enters the language.
That doesn't mean the tutorials and code that newbies are going to be looking at are going to start using this syntax a year from when this enters the language.
-bob
- Previous message: [Python-Dev] Pep 318 - new syntax (esp for wrappers)
- Next message: [Python-Dev] importing from files with currently invalid names
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]