[Python-Dev] deco_fun_expr(= vs. @deco_fun_expr

Bengt Richter bokr at oz.net
Wed Aug 11 21:26:46 CEST 2004


Just wanted to make sure this got into python-dev as an alternative ;-)
Example using post-fixed '(=' instead of prefixed '@':

deco1(=
decomodule.deco2(=
def foo():
    pass

effect is same as with prefixed-@ syntax, i.e., foo = deco1(decomodule.deco2(foo))
(except either way there's no intermediate foo binding during evaluation, I gather?)

Advantages:
1. currently illegal syntax, UIAM
2. lets callable-returning expression have unchanged grammar up to new (= trailer part
2. doesn't use up '@' or interfere with tools that use it
3. expresses calling in the proper nested way (inner before outer). No confusion about "backwards."
4. Leaves the door open to callable-calls operating on other code-block-derived
   arguments than from def and its suite (e.g. class and suite). Leaves door open for explicit
    =) end-of-block-arg mark if that should turn out useful for demarcation of otherwise
    ambiguous block endings, for some future use.
   
Unfortunately vexing personal matters will demand priority attention for some time again :-(
Bye for now.

Regards,
Bengt Richter


More information about the Python-Dev mailing list