strange TypeError exception in function compiled from a string

bruno.desthuilliers at gmail.com bruno.desthuilliers at gmail.com
Wed Dec 1 09:17:57 EST 2010


On 1 déc, 14:48, nelson <nelson1... at gmail.com> wrote:
> Hi all,
>   I have this function, defined in a string and ecetuted through ad
> exec call
>
> def cell1(d):
>
>     x=d.get('x')
>     print x
>
>     import y
>     return y.add(y.add(self.adf0(x),self.adf0(x)),self.adf0(x))
>
> d is a dict of this kind {'x':2}
>
> I receive the following exception, that i find very strange...
>
>   File "<string>", line 7, in cell1
> TypeError: 'dict' object is not callable
>
> I have tested all the function al line 7, and none of them raise any
> exception.
> Have anyone some suggestion on how to solve this?
>

Not without the minimal executable code reproducing your error.



More information about the Python-list mailing list