On 2013-11-17 11:34, Ned Batchelder wrote: > Functions have a __name__ attribute, which is the name they were > defined as: > > >>> def foo(): pass > ... > >>> foo.__name__ > 'foo' > >>> bar = foo > >>> bar.__name__ > 'foo'
which they have even in less-than-useful situations: (lambda s: s.lower()).__name__ accurately returns that its name is "<lambda>". So you get what you pay for ;-) -tkc -- https://mail.python.org/mailman/listinfo/python-list