zero new keyword decorator

R

Roman Suzi

After a week of reading decorator discussion my mind slowly
turnes in the opposite direction: to find which syntaxes are absolutely
unwanted.

It seems that people like @ more than lambda, so this will never be in Python:

def fun:
dec1; dec2; dec3
lambda x, y:
""" docs """
body


Also our decorator discussion reminds me of Forth

BUILD>

DOES>

words. That is, decorators and arglist are after-build and
"does" part - after the ":".

Why not?


build fun(arg1, arg2):
decor1; decor2
decor3
def:
body
else:
(if everything went right)

Or, if we want to catch errors in decorators, a special version:


try def fun(arg1, arg2):
decor1; decor2
decor3
def:
body
except:
(if everything went wrong)
finally:
(anyway do this)


Or, if we want to say function is needed for decorators and not the other
way around:

for:
decor1
decor2
def fun(x, y):
body


What about

exec:
decor1
decor2
def fun(x, y):
body


Maybe this way we could get rid of '@':

decor1, decor2(a), decor3 for
def fun(x, y):
body



Sincerely yours, Roman Suzi
 
P

Peter Otten

Roman said:
After a week of reading decorator discussion my mind slowly
turnes in the opposite direction: to find which syntaxes are absolutely
unwanted.

Learn from Bengt Richter to keep a straight face while proposing something
really odd.
On the other hand - Guido could use his time machine to make these the
syntax suggestions that were avoided by the pie.
Speaking of which - why would he volunteer to take this pie straight into
Python's face. We need another Dan Sugalski.

Peter
 

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
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top