proposed syntax for multiline anony-functions (hopefully?)

icefapper at gmail.com icefapper at gmail.com
Thu Aug 21 05:06:59 EDT 2014


reasonable, but I don't like the close parens on the same line; even 
> 
> if this syntax is allowed, I'd frown on it in style guides, 
> 

thanks, bu what exactly do you find unlikeable in this syntax? the ")" is no new syntax, but simply a match for a previous "("; and you can put it anywhere because the "(" contents are space-insensitive: 
  
this would be a syntax error: 
a = def(): 
   print("gvr") 

this too: 
a = def(): 
  print("anon") 

but not this: 
a = (def(): 
   print("no") 
) 

neither this: 
a = (def(): 
   print("d")) 

nor this: 
a = (def(): 
    print( "no" ) 


) 

we're all grown-ups, aren't we? if we wanted to mess the syntax up then "(" alone would have let us do obscene things like:

if (a
==
 b): gvr()

or

a =(1, 2
  5



    )

and we also could fiddle with an instance's (or class's) intendedly private members (no pun) but 

did we ever do?

yours truly would be glad to know your thoughts on this



More information about the Python-list mailing list