On Fri, Feb 10, 2017, at 11:05 AM, Chris Angelico wrote: > * What would the __name__ be? In "def ham.spam():", is the name "spam" > or "ham.spam"? Or say you have "def x[0]():" - is the name "x[0]" or > something else?
I'd say 'spam' in the first case, and a special value like '<unnamed function>' in the latter. You already can't rely on __name__ being a usable name in arbitrary callables: x[0] = lambda: 0 x[0].__name__ == '<lambda>' _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/