C
ChaosKCW
Hi
Is it possible to grab get an object returned from a string and a
callable ? e.g
I pass in a key value pair:
def somemethod(adict = {'new name for object': '<code to reutrn
obejct>'}):
object = .....
for key, value in adict.items():
if callable(value):
somedict[key] = value()
else:
somedict[key] = value
such that
somedict = {'new name for object': object}
??
Thanks,
Is it possible to grab get an object returned from a string and a
callable ? e.g
I pass in a key value pair:
def somemethod(adict = {'new name for object': '<code to reutrn
obejct>'}):
object = .....
for key, value in adict.items():
if callable(value):
somedict[key] = value()
else:
somedict[key] = value
such that
somedict = {'new name for object': object}
??
Thanks,