When is an int not an int? Who can explain this?

Chris Angelico rosuav at gmail.com
Mon Jan 18 11:19:59 EST 2016


On Tue, Jan 19, 2016 at 3:11 AM, Charles T. Smith
<cts.private.yahoo at gmail.com> wrote:
> $ python
> Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
> [GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> type(0) is int
> True
> ...
> (PDB)type(0) is int
> False
> (PDB)type(1) is int
> False

Possibility #1: 'int' has been rebound.

Possibility #2: 'type' has been rebound.

I'd check them in that order.

ChrisA



More information about the Python-list mailing list