deco_fun_expr(= vs. @deco_fun_expr

B

Bengt Richter

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top