proposed syntax for multiline anony-functions (hopefully?)

icefapper at gmail.com icefapper at gmail.com
Thu Aug 21 04:59:07 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" )


)

yours truly would be glad to know your thoughts on this



More information about the Python-list mailing list