mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
Suggest sys.maxsize as a reliable way to know whether the interpreter is 64-bit.
(part of #10735)
This commit is contained in:
parent
e0436bcb24
commit
f259076790
1 changed files with 11 additions and 1 deletions
|
|
@ -36,6 +36,16 @@ Cross Platform
|
||||||
and then only if the executable points to the Python interpreter. Reasonable
|
and then only if the executable points to the Python interpreter. Reasonable
|
||||||
defaults are used when the above needs are not met.
|
defaults are used when the above needs are not met.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
On Mac OS X (and perhaps other platforms), executable files may be
|
||||||
|
universal files containing multiple architectures.
|
||||||
|
|
||||||
|
To get at the "64-bitness" of the current interpreter, it is more
|
||||||
|
reliable to query the :attr:`sys.maxsize` attribute::
|
||||||
|
|
||||||
|
is_64bits = sys.maxsize > 2**32
|
||||||
|
|
||||||
|
|
||||||
.. function:: machine()
|
.. function:: machine()
|
||||||
|
|
||||||
|
|
@ -186,7 +196,7 @@ Windows Platform
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Note: this function works best with Mark Hammond's
|
This function works best with Mark Hammond's
|
||||||
:mod:`win32all` package installed, but also on Python 2.3 and
|
:mod:`win32all` package installed, but also on Python 2.3 and
|
||||||
later (support for this was added in Python 2.6). It obviously
|
later (support for this was added in Python 2.6). It obviously
|
||||||
only runs on Win32 compatible platforms.
|
only runs on Win32 compatible platforms.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue