OLD | NEW |
1 :mod:`sys` --- System-specific parameters and functions | 1 :mod:`sys` --- System-specific parameters and functions |
2 ======================================================= | 2 ======================================================= |
3 | 3 |
4 .. module:: sys | 4 .. module:: sys |
5 :synopsis: Access system-specific parameters and functions. | 5 :synopsis: Access system-specific parameters and functions. |
6 | 6 |
7 | 7 |
8 This module provides access to some variables used or maintained by the | 8 This module provides access to some variables used or maintained by the |
9 interpreter and to functions that interact strongly with the interpreter. It is | 9 interpreter and to functions that interact strongly with the interpreter. It is |
10 always available. | 10 always available. |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 This function wraps the Win32 :cfunc:`GetVersionEx` function; see the | 439 This function wraps the Win32 :cfunc:`GetVersionEx` function; see the |
440 Microsoft documentation on :cfunc:`OSVERSIONINFOEX` for more information | 440 Microsoft documentation on :cfunc:`OSVERSIONINFOEX` for more information |
441 about these fields. | 441 about these fields. |
442 | 442 |
443 Availability: Windows. | 443 Availability: Windows. |
444 | 444 |
445 .. versionchanged:: 3.2 | 445 .. versionchanged:: 3.2 |
446 Changed to a named tuple and added *service_pack_minor*, | 446 Changed to a named tuple and added *service_pack_minor*, |
447 *service_pack_major*, *suite_mask*, and *product_type*. | 447 *service_pack_major*, *suite_mask*, and *product_type*. |
448 | 448 |
| 449 |
| 450 .. data:: hash_info |
| 451 |
| 452 A structseq giving parameters of the numeric hash implementation. For |
| 453 more details about hashing of numeric types, see :ref:`numeric-hash`. |
| 454 |
| 455 +---------------------+--------------------------------------------------+ |
| 456 | attribute | explanation | |
| 457 +=====================+==================================================+ |
| 458 | :const:`width` | width in bits used for hash values | |
| 459 +---------------------+--------------------------------------------------+ |
| 460 | :const:`modulus` | prime modulus P used for numeric hash scheme | |
| 461 +---------------------+--------------------------------------------------+ |
| 462 | :const:`inf` | hash value returned for a positive infinity | |
| 463 +---------------------+--------------------------------------------------+ |
| 464 | :const:`nan` | hash value returned for a nan | |
| 465 +---------------------+--------------------------------------------------+ |
| 466 | :const:`imag` | multiplier used for the imaginary part of a | |
| 467 | | complex number | |
| 468 +---------------------+--------------------------------------------------+ |
| 469 |
| 470 .. versionadded:: 3.2 |
| 471 |
| 472 |
449 .. data:: hexversion | 473 .. data:: hexversion |
450 | 474 |
451 The version number encoded as a single integer. This is guaranteed to increa
se | 475 The version number encoded as a single integer. This is guaranteed to increa
se |
452 with each version, including proper support for non-production releases. For | 476 with each version, including proper support for non-production releases. For |
453 example, to test that the Python interpreter is at least version 1.5.2, use:: | 477 example, to test that the Python interpreter is at least version 1.5.2, use:: |
454 | 478 |
455 if sys.hexversion >= 0x010502F0: | 479 if sys.hexversion >= 0x010502F0: |
456 # use some advanced feature | 480 # use some advanced feature |
457 ... | 481 ... |
458 else: | 482 else: |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 framework. | 950 framework. |
927 | 951 |
928 | 952 |
929 .. data:: winver | 953 .. data:: winver |
930 | 954 |
931 The version number used to form registry keys on Windows platforms. This is | 955 The version number used to form registry keys on Windows platforms. This is |
932 stored as string resource 1000 in the Python DLL. The value is normally the | 956 stored as string resource 1000 in the Python DLL. The value is normally the |
933 first three characters of :const:`version`. It is provided in the :mod:`sys` | 957 first three characters of :const:`version`. It is provided in the :mod:`sys` |
934 module for informational purposes; modifying this value has no effect on the | 958 module for informational purposes; modifying this value has no effect on the |
935 registry keys used by Python. Availability: Windows. | 959 registry keys used by Python. Availability: Windows. |
OLD | NEW |