n00b formatting

Verde Denim tdldev at gmail.com
Thu Feb 24 17:54:57 EST 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`.
>
> Cheers,
> Chris
>

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...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110224/16908982/attachment-0001.html>


More information about the Python-list mailing list