Why does int(maxint) give a long, but int(int(maxint)) give an int? Is this a NumPy bug?

Viewed 342

Pretty self-explanatory (I'm on Windows):

>>> import sys, numpy
>>> a = numpy.int_(sys.maxint)
>>> int(a).__class__
<type 'long'>
>>> int(int(a)).__class__
<type 'int'>

Why does calling int once give me a long, whereas calling it twice gives me an int?

Is this a bug or a feature?

2 Answers
Related