In <[EMAIL PROTECTED]>, Venky wrote: >> Do you mean that you want to add it to globals()? >> >> globals()['SomeClass'] = cl >> >> myinst = SomeClass() >> print isinstance(myinst, SomeClass) >> print isinstance(myinst, BaseClass) >> > > Thanks. That's what I was looking for.
Probably not because now you have to know the name when you write the static source code. You said the names are discovered at runtime, so how do you know it's `SomeClass`? Put you classes into a dictionary with the name as key. `globals()` is a dictionary too, but it is more work to get an object by name from it (globals()['SomeClass'] vs. some_dict['SomeClass']) and you don't risk that some of your dynamically created classes overwrites an existing one with the same name. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list