dynamic class instantiation
Ognen Duzlevski
maketo at ukato.freeshell.org
Tue Jan 31 07:01:17 EST 2006
More information about the Python-list mailing list
Tue Jan 31 07:01:17 EST 2006
- Previous message (by thread): dynamic class instantiation
- Next message (by thread): dynamic class instantiation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Kent Johnson <kent at kentsjohnson.com> wrote: > Ognen Duzlevski wrote: > > Say I got "page" as a string. How do I go about > > instantiating a class from this piece of information? To make it > > more obvious how do I create the page() class based on the "page" > > string I have? > Use getattr(). Hi Kent, this is exactly what I was looking for. I can't believe I didn't think of getattr() myself! ;( Cheers, Ognen
- Previous message (by thread): dynamic class instantiation
- Next message (by thread): dynamic class instantiation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list