strange TypeError exception in function compiled from a string

Piet van Oostrum piet at vanoostrum.org
Thu Dec 2 11:09:25 EST 2010


nelson <nelson1977 at gmail.com> writes:


> 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))
>
What is self in line 7?
-- 
Piet van Oostrum <piet at vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
Nu Fair Trade woonartikelen op http://www.zylja.com



More information about the Python-list mailing list