tdldev at gmail.com
Thu Feb 24 23:54:57 CET 2011
On Thu, Feb 24, 2011 at 12:23 PM, Chris Rebert <clp2 at rebertia.com> wrote:
> On Thu, Feb 24, 2011 at 8:41 AM, Verde Denim <tdldev at gmail.com> wrote:
> > hi, all
> > i can't believe i don't see this, but
> > python from the command line:
> >>>> x = '0D'
> >>>> y = '0x' + x
> >>>> print "%d" % int(y,0)
> > 13
> > content of testme.py:
> Is this the *entire* contents of the file? I suspect not, and that
> somewhere in it you assign to `int` as a variable, which should not be
> done since it's the name of the built-in type.
> > x = '0D'
> > y = '0x' + x
> > print "%d" % int(y,0)
> > TypeError: 'int' object is not callable
> > what am i not seeing here??
> Please include the full exception Traceback.
> Also, add:
> print type(int), int
> just before the existing `print`.
Found it... I can't believe I did this in the code...
x = int = 0 ... Clobbered 'int' ...
i hate n00b mistakes.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list