Samuel wrote in news:1159883162.906612.292870 at c28g2000cwb.googlegroups.com
in comp.lang.python:
> Hi,
>> I am trying to replace the eval() in the following code:
>> def myfunc(type, table):
> module = __import__(type)
> type = 'module' + '.' + type
> obj = eval(type)
> return obj(row[table.c.name], row[table.c.handle])
>
>>> m = __import__( "StringIO" )
>>> x = getattr( m, "StringIO" )()
>>> x
<StringIO.StringIO instance at 0x00A47710>
>>>
Rob.