Why can function definitions only use identifiers, and not attribute references or any other primaries?

Why can function definitions only use identifiers, and not attribute references or any other primaries?

Post by Gary Herro » Sat, 25 Apr 2009 00:18:42



Things like your suggestion are called "syntactic-sugar" -- syntax that
adds a convenience, but *no* new functionality. Python has plenty of
"syntactic-sugar"s, and more will be added in the future. To make an
argument for such an addition, one would have to describe some
compelling (and general) use cases in a well-argued PEP. You're welcome
to try, but be forewarned, most PEP's (especially syntax changing PEPs)
don't fly far.