On 01.06.2016 01:10, Greg Ewing wrote:
Steven D'Aprano wrote:
name -> Function(args)
will be expanded to:
name = Function('name', args)
Another possibility would be to expand it to
name = Function(args) name.__name__ = "name"
Another possibility would be (requiring no syntax change):
name = function(args)
would always be expanded to
name = function(args) name.__name__ = "name"
name = function(args) # and function.__name__ is already available while function is called
Maybe, somebody knows a reason why a called callable shouldn't know that piece of information. I can't think of one.
If there's no assignment, __name__ is None.