[Grok-dev] Creating an object from a path

Paul Wilson paulalexwilson at gmail.com
Fri Feb 6 10:04:52 EST 2009


2009/2/6 Sebastian Ware <sebastian at urbantalk.se>:
> If I have a string:
>
>   "<class 'trigger.promotion.Promotion'>"
>
> can I create an object of the type [trigger.promotion.Promotion]?

You mean like:

classobj = eval('trigger.promotion.Promotion')
instanceobj = classobj()

Thanks,
Paul


More information about the Grok-dev mailing list