why () is () and [] is [] work in other way?

Robert Kern robert.kern at gmail.com
Thu Apr 26 08:12:23 EDT 2012


On 4/26/12 12:56 PM, Chris Angelico wrote:

> Side point: In Python 2, id() returns an int, not a long. Is it
> possible to be running Python on a 64-bit machine with a 32-bit int
> type?

Yes. Win64 has 64-bit pointers and 32-bit C longs (and thus 32-bit Python ints).

> And if so, what does CPython do? Return the address modulo 4G?

It returns a Python long.

Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import sys
 >>> sys.maxint
2147483647
 >>> id('Hello')
30521584L

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list