REPOST: Re: [BEGINNER] meta-functions

Richard Philips Richard.Philips at ua.ac.be
Wed Dec 26 12:26:31 EST 2001


Igor Mozetic wrote:

>A simple question from a newbie, sorry.
>
>I have functions defined normally, def fname(arg1,arg2):
>and also represented as tuples (fname, arg1, arg2),
>to use them by apply(fname, (arg1,arg2)) - no problem.
>
>How do I make a comparison:  fname == 'string' ?
>I found that I could use repr(fname) and parse the
>resulting string, but I consider this ugly.
>Is there a standard function to return a function name
>as a string?
>
>I'm restricted to Python 1.5.2.
>I'm not on the list, please reply to me.
>
>-Igor Mozetic
>
See:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52315


Richard Philips

========= WAS CANCELLED BY =======:
Path: news.sol.net!spool0-nwblwi.newsops.execpc.com!newsfeeds.sol.net!news-out.visi.com!hermes.visi.com!news.tele.dk!small.news.tele.dk!134.75.7.11!nntp.kreonet.re.kr!feeder.kornet.net!news1.kornet.net!ua4canc3ll3r
From: Richard Philips <Richard.Philips at ua.ac.be>
Newsgroups: comp.lang.python
Subject: cmsg cancel <3C2A0847.9030605 at ua.ac.be>
Control: cancel <3C2A0847.9030605 at ua.ac.be>
Date: Mon, 31 Dec 2001 04:45:58 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.3C2A0847.9030605 at ua.ac.be>
NNTP-Posting-Host: 211.57.49.2
X-Trace: news2.kornet.net 1009776169 27193 211.57.49.2 (31 Dec 2001 05:22:49 GMT)
X-Complaints-To: usenet at news2.kornet.net
NNTP-Posting-Date: Mon, 31 Dec 2001 05:22:49 +0000 (UTC)
X-No-Archive: yes
X-Unac4ncel: yes
X-Commentary: I love NewsAgent 1.10 and the Sandblaster Cancel Engine Build 74 (19 March 1999)

This message was cancelled from within Mozilla.



More information about the Python-list mailing list