In Python, given the string\'int\', how can I get the type int? Using getattr(current_module, \'int\') doesn\'t work.
\'int\'
int
getattr(current_module, \'int\')
Try with an eval():
eval()
>>>eval('int')
But be sure of what you give to eval(); it could be dangerous.