Re: Opposite of repr() (kind of)

2008-04-21 Thread Guillermo
This must be the dumbest question ever... Solved. On Apr 21, 1:05 pm, Guillermo <[EMAIL PROTECTED]> wrote: > Hi there, > > How can I turn a string into a callable object/function? > > I have a = 'len', and I want to do: if callable(eval(a)): print > "callable", but that doesn't quite work the wa

Re: Opposite of repr() (kind of)

2008-04-21 Thread TimeHorse
On Apr 21, 7:05 am, Guillermo <[EMAIL PROTECTED]> wrote: > Hi there, > > How can I turn a string into a callable object/function? > > I have a = 'len', and I want to do: if callable(eval(a)): print > "callable", but that doesn't quite work the way I want. :) > > Regards, > > Guillermo What version

Re: Opposite of repr() (kind of)

2008-04-21 Thread Bruno Desthuilliers
Guillermo a écrit : > Hi there, > > How can I turn a string into a callable object/function? Depends on what's in your string. > I have a = 'len', and I want to do: if callable(eval(a)): print > "callable", but that doesn't quite work the way I want. :) Works here: Python 2.5.1 (r251:54863, May

Opposite of repr() (kind of)

2008-04-21 Thread Guillermo
Hi there, How can I turn a string into a callable object/function? I have a = 'len', and I want to do: if callable(eval(a)): print "callable", but that doesn't quite work the way I want. :) Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list