@@ -333,23 +333,21 @@ always available.
333
333
*wasm32-emscripten * platform. The named tuple is provisional and may change
334
334
in the future.
335
335
336
- .. tabularcolumns :: |l|L|
337
-
338
- +-----------------------------+----------------------------------------------+
339
- | Attribute | Explanation |
340
- +=============================+==============================================+
341
- | :const: `emscripten_version ` | Emscripten version as tuple of ints |
342
- | | (major, minor, micro), e.g. ``(3, 1, 8) ``. |
343
- +-----------------------------+----------------------------------------------+
344
- | :const: `runtime ` | Runtime string, e.g. browser user agent, |
345
- | | ``'Node.js v14.18.2' ``, or ``'UNKNOWN' ``. |
346
- +-----------------------------+----------------------------------------------+
347
- | :const: `pthreads ` | ``True `` if Python is compiled with |
348
- | | Emscripten pthreads support. |
349
- +-----------------------------+----------------------------------------------+
350
- | :const: `shared_memory ` | ``True `` if Python is compiled with shared |
351
- | | memory support. |
352
- +-----------------------------+----------------------------------------------+
336
+ .. attribute :: _emscripten_info.emscripten_version
337
+
338
+ Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, 8) ``.
339
+
340
+ .. attribute :: _emscripten_info.runtime
341
+
342
+ Runtime string, e.g. browser user agent, ``'Node.js v14.18.2' ``, or ``'UNKNOWN' ``.
343
+
344
+ .. attribute :: _emscripten_info.pthreads
345
+
346
+ ``True `` if Python is compiled with Emscripten pthreads support.
347
+
348
+ .. attribute :: _emscripten_info.shared_memory
349
+
350
+ ``True `` if Python is compiled with shared memory support.
353
351
354
352
.. availability :: Emscripten.
355
353
@@ -515,28 +513,62 @@ always available.
515
513
The :term: `named tuple ` *flags * exposes the status of command line
516
514
flags. The attributes are read only.
517
515
518
- ============================== ==============================================================================================================
519
- attribute flag
520
- ============================== ==============================================================================================================
521
- :const: `debug ` :option: `-d `
522
- :const: `inspect ` :option: `-i `
523
- :const: `interactive ` :option: `-i `
524
- :const: `isolated ` :option: `-I `
525
- :const: `optimize ` :option: `-O ` or :option: `-OO `
526
- :const: `dont_write_bytecode ` :option: `-B `
527
- :const: `no_user_site ` :option: `-s `
528
- :const: `no_site ` :option: `-S `
529
- :const: `ignore_environment ` :option: `-E `
530
- :const: `verbose ` :option: `-v `
531
- :const: `bytes_warning ` :option: `-b `
532
- :const: `quiet ` :option: `-q `
533
- :const: `hash_randomization ` :option: `-R `
534
- :const: `dev_mode ` :option: `-X dev <-X> ` (:ref: `Python Development Mode <devmode >`)
535
- :const: `utf8_mode ` :option: `-X utf8 <-X> `
536
- :const: `safe_path ` :option: `-P `
537
- :const: `int_max_str_digits ` :option: `-X int_max_str_digits <-X> ` (:ref: `integer string conversion length limitation <int_max_str_digits >`)
538
- :const: `warn_default_encoding ` :option: `-X warn_default_encoding <-X> `
539
- ============================== ==============================================================================================================
516
+ .. list-table ::
517
+
518
+ * - .. attribute:: flags.debug
519
+ - :option: `-d `
520
+
521
+ * - .. attribute:: flags.inspect
522
+ - :option: `-i `
523
+
524
+ * - .. attribute:: flags.interactive
525
+ - :option: `-i `
526
+
527
+ * - .. attribute:: flags.isolated
528
+ - :option: `-I `
529
+
530
+ * - .. attribute:: flags.optimize
531
+ - :option: `-O ` or :option: `-OO `
532
+
533
+ * - .. attribute:: flags.dont_write_bytecode
534
+ - :option: `-B `
535
+
536
+ * - .. attribute:: flags.no_user_site
537
+ - :option: `-s `
538
+
539
+ * - .. attribute:: flags.no_site
540
+ - :option: `-S `
541
+
542
+ * - .. attribute:: flags.ignore_environment
543
+ - :option: `-E `
544
+
545
+ * - .. attribute:: flags.verbose
546
+ - :option: `-v `
547
+
548
+ * - .. attribute:: flags.bytes_warning
549
+ - :option: `-b `
550
+
551
+ * - .. attribute:: flags.quiet
552
+ - :option: `-q `
553
+
554
+ * - .. attribute:: flags.hash_randomization
555
+ - :option: `-R `
556
+
557
+ * - .. attribute:: flags.dev_mode
558
+ - :option: `-X dev <-X> ` (:ref: `Python Development Mode <devmode >`)
559
+
560
+ * - .. attribute:: flags.utf8_mode
561
+ - :option: `-X utf8 <-X> `
562
+
563
+ * - .. attribute:: flags.safe_path
564
+ - :option: `-P `
565
+
566
+ * - .. attribute:: flags.int_max_str_digits
567
+ - :option: `-X int_max_str_digits <-X> `
568
+ (:ref: `integer string conversion length limitation <int_max_str_digits >`)
569
+
570
+ * - .. attribute:: flags.warn_default_encoding
571
+ - :option: `-X warn_default_encoding <-X> `
540
572
541
573
.. versionchanged :: 3.2
542
574
Added ``quiet `` attribute for the new :option: `-q ` flag.
@@ -923,8 +955,8 @@ always available.
923
955
| | a domain controller. |
924
956
+---------------------------------------+---------------------------------+
925
957
926
- This function wraps the Win32 :c:func: `GetVersionEx ` function; see the
927
- Microsoft documentation on :c:func: `OSVERSIONINFOEX ` for more information
958
+ This function wraps the Win32 :c:func: `! GetVersionEx ` function; see the
959
+ Microsoft documentation on :c:func: `! OSVERSIONINFOEX ` for more information
928
960
about these fields.
929
961
930
962
*platform_version * returns the major version, minor version and
@@ -982,28 +1014,37 @@ always available.
982
1014
implementation. For more details about hashing of numeric types, see
983
1015
:ref: `numeric-hash `.
984
1016
985
- +---------------------+--------------------------------------------------+
986
- | attribute | explanation |
987
- +=====================+==================================================+
988
- | :const: `width ` | width in bits used for hash values |
989
- +---------------------+--------------------------------------------------+
990
- | :const: `modulus ` | prime modulus P used for numeric hash scheme |
991
- +---------------------+--------------------------------------------------+
992
- | :const: `inf ` | hash value returned for a positive infinity |
993
- +---------------------+--------------------------------------------------+
994
- | :const: `nan ` | (this attribute is no longer used) |
995
- +---------------------+--------------------------------------------------+
996
- | :const: `imag ` | multiplier used for the imaginary part of a |
997
- | | complex number |
998
- +---------------------+--------------------------------------------------+
999
- | :const: `algorithm ` | name of the algorithm for hashing of str, bytes, |
1000
- | | and memoryview |
1001
- +---------------------+--------------------------------------------------+
1002
- | :const: `hash_bits ` | internal output size of the hash algorithm |
1003
- +---------------------+--------------------------------------------------+
1004
- | :const: `seed_bits ` | size of the seed key of the hash algorithm |
1005
- +---------------------+--------------------------------------------------+
1017
+ .. attribute :: hash_info.width
1018
+
1019
+ The width in bits used for hash values
1020
+
1021
+ .. attribute :: hash_info.modulus
1006
1022
1023
+ The prime modulus P used for numeric hash scheme
1024
+
1025
+ .. attribute :: hash_info.inf
1026
+
1027
+ The hash value returned for a positive infinity
1028
+
1029
+ .. attribute :: hash_info.nan
1030
+
1031
+ (This attribute is no longer used)
1032
+
1033
+ .. attribute :: hash_info.imag
1034
+
1035
+ The multiplier used for the imaginary part of a complex number
1036
+
1037
+ .. attribute :: hash_info.algorithm
1038
+
1039
+ The name of the algorithm for hashing of str, bytes, and memoryview
1040
+
1041
+ .. attribute :: hash_info.hash_bits
1042
+
1043
+ The internal output size of the hash algorithm
1044
+
1045
+ .. attribute :: hash_info.seed_bits
1046
+
1047
+ The size of the seed key of the hash algorithm
1007
1048
1008
1049
.. versionadded :: 3.2
1009
1050
@@ -1081,32 +1122,31 @@ always available.
1081
1122
A :term: `named tuple ` that holds information about Python's internal
1082
1123
representation of integers. The attributes are read only.
1083
1124
1084
- .. tabularcolumns :: |l|L|
1085
-
1086
- +----------------------------------------+-----------------------------------------------+
1087
- | Attribute | Explanation |
1088
- +========================================+===============================================+
1089
- | :const: `bits_per_digit ` | number of bits held in each digit. Python |
1090
- | | integers are stored internally in base |
1091
- | | ``2**int_info.bits_per_digit `` |
1092
- +----------------------------------------+-----------------------------------------------+
1093
- | :const: `sizeof_digit ` | size in bytes of the C type used to |
1094
- | | represent a digit |
1095
- +----------------------------------------+-----------------------------------------------+
1096
- | :const: `default_max_str_digits ` | default value for |
1097
- | | :func: `sys.get_int_max_str_digits ` when it |
1098
- | | is not otherwise explicitly configured. |
1099
- +----------------------------------------+-----------------------------------------------+
1100
- | :const: `str_digits_check_threshold ` | minimum non-zero value for |
1101
- | | :func: `sys.set_int_max_str_digits `, |
1102
- | | :envvar: `PYTHONINTMAXSTRDIGITS `, or |
1103
- | | :option: `-X int_max_str_digits <-X> `. |
1104
- +----------------------------------------+-----------------------------------------------+
1125
+ .. attribute :: int_info.bits_per_digit
1126
+
1127
+ The number of bits held in each digit.
1128
+ Python integers are stored internally in base ``2**int_info.bits_per_digit ``.
1129
+
1130
+ .. attribute :: int_info.sizeof_digit
1131
+
1132
+ The size in bytes of the C type used to represent a digit.
1133
+
1134
+ .. attribute :: int_info.default_max_str_digits
1135
+
1136
+ The default value for :func: `sys.get_int_max_str_digits `
1137
+ when it is not otherwise explicitly configured.
1138
+
1139
+ .. attribute :: int_info.str_digits_check_threshold
1140
+
1141
+ The minimum non-zero value for :func: `sys.set_int_max_str_digits `,
1142
+ :envvar: `PYTHONINTMAXSTRDIGITS `, or :option: `-X int_max_str_digits <-X> `.
1105
1143
1106
1144
.. versionadded :: 3.1
1107
1145
1108
1146
.. versionchanged :: 3.11
1109
- Added ``default_max_str_digits `` and ``str_digits_check_threshold ``.
1147
+
1148
+ Added :attr: `~int_info.default_max_str_digits ` and
1149
+ :attr: `~int_info.str_digits_check_threshold `.
1110
1150
1111
1151
1112
1152
.. data :: __interactivehook__
@@ -1533,7 +1573,7 @@ always available.
1533
1573
:file: `Objects/lnotab_notes.txt ` for a detailed explanation of how this
1534
1574
works.
1535
1575
Per-line events may be disabled for a frame by setting
1536
- :attr: `f_trace_lines ` to :const: `False ` on that frame.
1576
+ :attr: `! f_trace_lines ` to :const: `False ` on that :ref: ` frame < frame-objects >` .
1537
1577
1538
1578
``'return' ``
1539
1579
A function (or other code block) is about to return. The local trace
@@ -1551,8 +1591,8 @@ always available.
1551
1591
opcode details). The local trace function is called; *arg * is
1552
1592
``None ``; the return value specifies the new local trace function.
1553
1593
Per-opcode events are not emitted by default: they must be explicitly
1554
- requested by setting :attr: `f_trace_opcodes ` to :const: `True ` on the
1555
- frame.
1594
+ requested by setting :attr: `! f_trace_opcodes ` to :const: `True ` on the
1595
+ :ref: ` frame < frame-objects >` .
1556
1596
1557
1597
Note that as an exception is propagated down the chain of callers, an
1558
1598
``'exception' `` event is generated at each level.
@@ -1581,8 +1621,8 @@ always available.
1581
1621
1582
1622
.. versionchanged :: 3.7
1583
1623
1584
- ``'opcode' `` event type added; :attr: `f_trace_lines ` and
1585
- :attr: `f_trace_opcodes ` attributes added to frames
1624
+ ``'opcode' `` event type added; :attr: `! f_trace_lines ` and
1625
+ :attr: `! f_trace_opcodes ` attributes added to frames
1586
1626
1587
1627
.. function :: set_asyncgen_hooks(firstiter, finalizer)
1588
1628
@@ -1739,7 +1779,7 @@ always available.
1739
1779
However, if you are writing a library (and do not control in which
1740
1780
context its code will be executed), be aware that the standard streams
1741
1781
may be replaced with file-like objects like :class: `io.StringIO ` which
1742
- do not support the :attr: ` ~io.BufferedIOBase. buffer ` attribute.
1782
+ do not support the :attr: ! buffer` attribute.
1743
1783
1744
1784
1745
1785
.. data :: __stdin__
@@ -1787,29 +1827,28 @@ always available.
1787
1827
A :term: `named tuple ` holding information about the thread
1788
1828
implementation.
1789
1829
1790
- .. tabularcolumns :: |l|p{0.7\linewidth}|
1791
-
1792
- +------------------+---------------------------------------------------------+
1793
- | Attribute | Explanation |
1794
- +==================+=========================================================+
1795
- | :const: `name ` | Name of the thread implementation: |
1796
- | | |
1797
- | | * ``'nt' ``: Windows threads |
1798
- | | * ``'pthread' ``: POSIX threads |
1799
- | | * ``'pthread-stubs' ``: stub POSIX threads |
1800
- | | (on WebAssembly platforms without threading support) |
1801
- | | * ``'solaris' ``: Solaris threads |
1802
- +------------------+---------------------------------------------------------+
1803
- | :const: `lock ` | Name of the lock implementation: |
1804
- | | |
1805
- | | * ``'semaphore' ``: a lock uses a semaphore |
1806
- | | * ``'mutex+cond' ``: a lock uses a mutex |
1807
- | | and a condition variable |
1808
- | | * ``None `` if this information is unknown |
1809
- +------------------+---------------------------------------------------------+
1810
- | :const: `version ` | Name and version of the thread library. It is a string, |
1811
- | | or ``None `` if this information is unknown. |
1812
- +------------------+---------------------------------------------------------+
1830
+ .. attribute :: thread_info.name
1831
+
1832
+ The name of the thread implementation:
1833
+
1834
+ * ``"nt" ``: Windows threads
1835
+ * ``"pthread" ``: POSIX threads
1836
+ * ``"pthread-stubs" ``: stub POSIX threads
1837
+ (on WebAssembly platforms without threading support)
1838
+ * ``"solaris" ``: Solaris threads
1839
+
1840
+ .. attribute :: thread_info.lock
1841
+
1842
+ The name of the lock implementation:
1843
+
1844
+ * ``"semaphore" ``: a lock uses a semaphore
1845
+ * ``"mutex+cond" ``: a lock uses a mutex and a condition variable
1846
+ * ``None `` if this information is unknown
1847
+
1848
+ .. attribute :: thread_info.version
1849
+
1850
+ The name and version of the thread library.
1851
+ It is a string, or ``None `` if this information is unknown.
1813
1852
1814
1853
.. versionadded :: 3.3
1815
1854
0 commit comments