[Python-ideas] Default arguments in Python - the return - running out of ideas but...

Scott David Daniels Scott.Daniels at Acm.Org
Wed May 13 21:30:04 CEST 2009


spir wrote:
> My opinion on this is you're basically right. Even 'print' (for py<3.0) could be an identifier you could use in an assignment (or in any value expression), I guess, for parse patterns are different:
>    print_statement : "print" expression
>    assignment      : name '=' expression
> So you can safely have "print" as name, or inside an expression. Even "print print" should work !

But you would not want
     print print
and
     print(print)
to have two different meanings.
In Python, extra parens are fair around expressions,
and print(print) is clearly a function call.

--Scott David Daniels
Scott.Daniels at Acm.Org




More information about the Python-ideas mailing list