Re: Obtaining "the" name of a function/method

2013-11-17 Thread Cameron Simpson
On 17Nov2013 13:47, Tim Chase wrote: > 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.__nam

Re: Obtaining "the" name of a function/method

2013-11-17 Thread John Ladasky
On Sunday, November 17, 2013 11:34:15 AM UTC-8, Ned Batchelder wrote: > Functions have a __name__ attribute, which is the name they were defined as: Thank you, that's exactly what I needed. -- https://mail.python.org/mailman/listinfo/python-list

Re: Obtaining "the" name of a function/method

2013-11-17 Thread Tim Chase
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-usefu

Re: Obtaining "the" name of a function/method

2013-11-17 Thread Ned Batchelder
On Sunday, November 17, 2013 2:24:19 PM UTC-5, John Ladasky wrote: > Hi, folks, > > Here's a minimal Python 3.3.2 code example, and its output: > > = > > def foo(): > pass > > print(foo) > bar = foo > print(bar) > > ==