Why does the Python 2.7 AMD 64 installer seem to run Python in 32 bit mode?

后端 未结 2 1146
清酒与你
清酒与你 2020-11-28 13:43

I\'ve installed Python 2.7 from the python-2.7.amd64.msi package from python.org. It installs and runs correctly, but seems to be in 32-bit mode, despite the fact that the

相关标签:
2条回答
  • 2020-11-28 14:34

    See the discussion here. It's from 2.6.1, but it seems to still apply. I haven't seen evidence to the contrary anywhere, at least. The gist of the matter (quoted from that link) is:

    This is by design. In their infinitive wisdom Microsoft has decided to make the 'long' C type always a 32 bit signed integer - even on 64bit systems. On most Unix systems a long is at least 32 bit but usually sizeof(ptr).

    0 讨论(0)
  • 2020-11-28 14:40

    On my x86-64 Linux:

    $ python
    Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
    [GCC 4.4.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys, platform
    >>> platform.architecture()
    ('64bit', 'ELF')
    >>> sys.maxint
    9223372036854775807
    

    Of course, what matters more than integer size is how much memory you can allocate. Maybe your smaller ints won't really matter much, since Python will just promote to a long any way, but if you can allocate more than three gigs of memory, you'll still be enjoying the benefits of 64 bit execution.

    0 讨论(0)
提交回复
热议问题