thank you for clarifying exactly what's going on. other than the __qualname__, in what other ways do the two different bindings differ from each other?
however, this still goes in the bucket of why i personally dislike python. this just seems sloppy and overly complicated.
for example, i tested this out myself.
> test = lambda x : x*x
> test
=> <function <lambda> at 0x7ff6221d76e0>
> test.__qualname__
Traceback (most recent call last):
File "python", line 1, in <module>
AttributeError: 'function' object has no attribute '__qualname__'
> test.__qualname__ = "test"
> test
=> <function <lambda> at 0x7ff6221d76e0>
so the repl still reports <lambda> instead of test. actually it turns out that even
def doesn't seem to set the __qualname__ property, so i don't get the same thing as you (i am using repl.it which apparently uses python 2.7.10). however, using dir(test) showed that there is the func_name property.
> def test2(x):
> return x*x
> test2.__qualname__
Traceback (most recent call last):
File "python", line 1, in <module>
AttributeError: 'function' object has no attribute '__qualname__'
> test2.func_name
=> 'test2'
> test.func_name
=> '<lambda>'
that seems to be the property that the repl reports, as it gets set by the lambda assignment and the
def keyword to the function name. (i verified that by altering the func_name property manually.)
yet, somehow, people call python "simple".