(no subject)
Oleg Broytmann
phd at phd.pp.ru
Tue Nov 27 12:13:35 EST 2001
On Tue, Nov 27, 2001 at 05:11:26PM -0000, toffer_ji0 at subdimension.com wrote:
> is it possible to call or rather use an instantiated class using, say
> a string (assuming unique)..
>
> i.e.
>
> anInstance = aClass('uniqueName')
> .
> .
> .
> 'uniqueName'.someMethod(someParameter)
>
> i'm doing this because i need keep a some classes in a list.. i find
> it intensive sometimes to use a for loop with if statements
> just to check if the class exist then use it...
Use dictionary, mapped by uniqueName strings.
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ phd at phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-list
mailing list