Re: Referencing vars, methods and classes by name
- From: "Gabriel Genellina" <gagsl-py@xxxxxxxxxxxx>
- Date: Thu, 08 Feb 2007 05:44:36 -0300
En Thu, 08 Feb 2007 05:29:23 -0300, Paul Rubin <"http://phr.cx"@NOSPAM.invalid> escribió:
"Sagari" <boyandin@xxxxxxxxx> writes:$a = ''b';
$obj->$a(); // call method b() of the instance $obj
What is the Python way of performing the same indirections?
For your last example we could say
obj.getattr(a)()
but even that is a bit ugly, depending.
Surely you meant to say getattr(obj, a)()
--
Gabriel Genellina
.
- Follow-Ups:
- Re: Referencing vars, methods and classes by name
- From: Paul Rubin
- Re: Referencing vars, methods and classes by name
- References:
- Referencing vars, methods and classes by name
- From: Sagari
- Re: Referencing vars, methods and classes by name
- From: Paul Rubin
- Referencing vars, methods and classes by name
- Prev by Date: Re: Referencing vars, methods and classes by name
- Next by Date: Re: Overloading the tilde operator?
- Previous by thread: Re: Referencing vars, methods and classes by name
- Next by thread: Re: Referencing vars, methods and classes by name
- Index(es):
Relevant Pages
|