On 1 June 2016 at 14:29, Sven R. Kunze firstname.lastname@example.org wrote:
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.
I'm not sure I follow this proposal. Could you explain a little please?
x = Symbol('x')
as the current approach, how would you modify that to work with your proposal? If you could show how you'd write a wrapper function AutoSymbol, so that
x = AutoSymbol()
did the same as the above, that'd help me a lot.