Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #10937
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!newsreader4.netcologne.de!news.netcologne.de!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!panix!not-for-mail |
|---|---|
| From | Grant Edwards <invalid@invalid.invalid> |
| Newsgroups | comp.lang.python |
| Subject | Re: Get the name of a function |
| Date | Fri, 5 Aug 2011 22:05:45 +0000 (UTC) |
| Organization | PANIX Public Access Internet and UNIX, NYC |
| Lines | 26 |
| Message-ID | <j1hpfp$p11$1@reader1.panix.com> (permalink) |
| References | <8295aba8-3eab-4c6e-b3b7-c3421d829220@f7g2000vba.googlegroups.com> |
| NNTP-Posting-Host | dsl.comtrol.com |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| X-Trace | reader1.panix.com 1312581945 25633 64.122.56.22 (5 Aug 2011 22:05:45 GMT) |
| X-Complaints-To | abuse@panix.com |
| NNTP-Posting-Date | Fri, 5 Aug 2011 22:05:45 +0000 (UTC) |
| User-Agent | slrn/pre0.9.9-102 (Linux) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:10937 |
Show key headers only | View raw
On 2011-08-05, gervaz <gervaz@gmail.com> wrote:
> Hi all, is there a way to retrive the function name like with
> self.__class__.__name__?
Not really. There may not be any such thing as "the function name". A
function may have zero names, it may have a dozen names. It may have
names but only in namespaces that aren't accessible.
This question comes up at least once a month, so look back through the
group for threads about finding an object's name, finding a
parameter's name, etc.
Here's a nice article on introspection, but what it talks about as a
"function name" probably isn't what you're interested in:
http://www.ibm.com/developerworks/library/l-pyint/index.html
Here's a stack-overflow question similar to yours:
http://stackoverflow.com/questions/1538342/how-can-i-get-the-name-of-an-object-in-python
--
Grant Edwards grant.b.edwards Yow! But they went to MARS
at around 1953!!
gmail.com
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Get the name of a function gervaz <gervaz@gmail.com> - 2011-08-05 11:52 -0700 Re: Get the name of a function Emile van Sebille <emile@fenx.com> - 2011-08-05 13:19 -0700 Re: Get the name of a function Chris Rebert <clp2@rebertia.com> - 2011-08-05 14:19 -0700 Re: Get the name of a function Grant Edwards <invalid@invalid.invalid> - 2011-08-05 22:05 +0000
csiph-web