turning a string into an object name

Marco Herrn herrn at gmx.net
Wed Apr 3 19:58:10 EST 2002


Hello. I know that it is possible to turn a string into a funtion call by
using getattr(). But what I want to achieve is turning a string into an
object name. 
I would have a method like

  foo(self, objname, objtype)

Then I would call this method like
  
  foo(myObj, bar)

Then the method foo should create an object with the name "myObj" from the
type bar.

Is such an thing possible? And if, how?

Thanks in advance
Marco

-- 
Marco Herrn             herrn at gmx.net
(GnuPG/PGP-signed and crypted mail preferred)
Key ID: 0x94620736




More information about the Python-list mailing list