@@ -329,23 +329,21 @@ always available.
329
329
*wasm32-emscripten * platform. The named tuple is provisional and may change
330
330
in the future.
331
331
332
- .. tabularcolumns :: |l|L|
333
-
334
- +-----------------------------+----------------------------------------------+
335
- | Attribute | Explanation |
336
- +=============================+==============================================+
337
- | :const: `emscripten_version ` | Emscripten version as tuple of ints |
338
- | | (major, minor, micro), e.g. ``(3, 1, 8) ``. |
339
- +-----------------------------+----------------------------------------------+
340
- | :const: `runtime ` | Runtime string, e.g. browser user agent, |
341
- | | ``'Node.js v14.18.2' ``, or ``'UNKNOWN' ``. |
342
- +-----------------------------+----------------------------------------------+
343
- | :const: `pthreads ` | ``True `` if Python is compiled with |
344
- | | Emscripten pthreads support. |
345
- +-----------------------------+----------------------------------------------+
346
- | :const: `shared_memory ` | ``True `` if Python is compiled with shared |
347
- | | memory support. |
348
- +-----------------------------+----------------------------------------------+
332
+ .. attribute :: _emscripten_info.emscripten_version
333
+
334
+ Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, 8) ``.
335
+
336
+ .. attribute :: _emscripten_info.runtime
337
+
338
+ Runtime string, e.g. browser user agent, ``'Node.js v14.18.2' ``, or ``'UNKNOWN' ``.
339
+
340
+ .. attribute :: _emscripten_info.pthreads
341
+
342
+ ``True `` if Python is compiled with Emscripten pthreads support.
343
+
344
+ .. attribute :: _emscripten_info.shared_memory
345
+
346
+ ``True `` if Python is compiled with shared memory support.
349
347
350
348
.. availability :: Emscripten.
351
349
@@ -511,28 +509,62 @@ always available.
511
509
The :term: `named tuple ` *flags * exposes the status of command line
512
510
flags. The attributes are read only.
513
511
514
- ============================== ==============================================================================================================
515
- attribute flag
516
- ============================== ==============================================================================================================
517
- :const: `debug ` :option: `-d `
518
- :const: `inspect ` :option: `-i `
519
- :const: `interactive ` :option: `-i `
520
- :const: `isolated ` :option: `-I `
521
- :const: `optimize ` :option: `-O ` or :option: `-OO `
522
- :const: `dont_write_bytecode ` :option: `-B `
523
- :const: `no_user_site ` :option: `-s `
524
- :const: `no_site ` :option: `-S `
525
- :const: `ignore_environment ` :option: `-E `
526
- :const: `verbose ` :option: `-v `
527
- :const: `bytes_warning ` :option: `-b `
528
- :const: `quiet ` :option: `-q `
529
- :const: `hash_randomization ` :option: `-R `
530
- :const: `dev_mode ` :option: `-X dev <-X> ` (:ref: `Python Development Mode <devmode >`)
531
- :const: `utf8_mode ` :option: `-X utf8 <-X> `
532
- :const: `safe_path ` :option: `-P `
533
- :const: `int_max_str_digits ` :option: `-X int_max_str_digits <-X> ` (:ref: `integer string conversion length limitation <int_max_str_digits >`)
534
- :const: `warn_default_encoding ` :option: `-X warn_default_encoding <-X> `
535
- ============================== ==============================================================================================================
512
+ .. list-table ::
513
+
514
+ * - .. attribute:: flags.debug
515
+ - :option: `-d `
516
+
517
+ * - .. attribute:: flags.inspect
518
+ - :option: `-i `
519
+
520
+ * - .. attribute:: flags.interactive
521
+ - :option: `-i `
522
+
523
+ * - .. attribute:: flags.isolated
524
+ - :option: `-I `
525
+
526
+ * - .. attribute:: flags.optimize
527
+ - :option: `-O ` or :option: `-OO `
528
+
529
+ * - .. attribute:: flags.dont_write_bytecode
530
+ - :option: `-B `
531
+
532
+ * - .. attribute:: flags.no_user_site
533
+ - :option: `-s `
534
+
535
+ * - .. attribute:: flags.no_site
536
+ - :option: `-S `
537
+
538
+ * - .. attribute:: flags.ignore_environment
539
+ - :option: `-E `
540
+
541
+ * - .. attribute:: flags.verbose
542
+ - :option: `-v `
543
+
544
+ * - .. attribute:: flags.bytes_warning
545
+ - :option: `-b `
546
+
547
+ * - .. attribute:: flags.quiet
548
+ - :option: `-q `
549
+
550
+ * - .. attribute:: flags.hash_randomization
551
+ - :option: `-R `
552
+
553
+ * - .. attribute:: flags.dev_mode
554
+ - :option: `-X dev <-X> ` (:ref: `Python Development Mode <devmode >`)
555
+
556
+ * - .. attribute:: flags.utf8_mode
557
+ - :option: `-X utf8 <-X> `
558
+
559
+ * - .. attribute:: flags.safe_path
560
+ - :option: `-P `
561
+
562
+ * - .. attribute:: flags.int_max_str_digits
563
+ - :option: `-X int_max_str_digits <-X> `
564
+ (:ref: `integer string conversion length limitation <int_max_str_digits >`)
565
+
566
+ * - .. attribute:: flags.warn_default_encoding
567
+ - :option: `-X warn_default_encoding <-X> `
536
568
537
569
.. versionchanged :: 3.2
538
570
Added ``quiet `` attribute for the new :option: `-q ` flag.
@@ -890,8 +922,8 @@ always available.
890
922
| | a domain controller. |
891
923
+---------------------------------------+---------------------------------+
892
924
893
- This function wraps the Win32 :c:func: `GetVersionEx ` function; see the
894
- Microsoft documentation on :c:func: `OSVERSIONINFOEX ` for more information
925
+ This function wraps the Win32 :c:func: `! GetVersionEx ` function; see the
926
+ Microsoft documentation on :c:func: `! OSVERSIONINFOEX ` for more information
895
927
about these fields.
896
928
897
929
*platform_version * returns the major version, minor version and
@@ -949,28 +981,37 @@ always available.
949
981
implementation. For more details about hashing of numeric types, see
950
982
:ref: `numeric-hash `.
951
983
952
- +---------------------+--------------------------------------------------+
953
- | attribute | explanation |
954
- +=====================+==================================================+
955
- | :const: `width ` | width in bits used for hash values |
956
- +---------------------+--------------------------------------------------+
957
- | :const: `modulus ` | prime modulus P used for numeric hash scheme |
958
- +---------------------+--------------------------------------------------+
959
- | :const: `inf ` | hash value returned for a positive infinity |
960
- +---------------------+--------------------------------------------------+
961
- | :const: `nan ` | (this attribute is no longer used) |
962
- +---------------------+--------------------------------------------------+
963
- | :const: `imag ` | multiplier used for the imaginary part of a |
964
- | | complex number |
965
- +---------------------+--------------------------------------------------+
966
- | :const: `algorithm ` | name of the algorithm for hashing of str, bytes, |
967
- | | and memoryview |
968
- +---------------------+--------------------------------------------------+
969
- | :const: `hash_bits ` | internal output size of the hash algorithm |
970
- +---------------------+--------------------------------------------------+
971
- | :const: `seed_bits ` | size of the seed key of the hash algorithm |
972
- +---------------------+--------------------------------------------------+
984
+ .. attribute :: hash_info.width
985
+
986
+ The width in bits used for hash values
987
+
988
+ .. attribute :: hash_info.modulus
973
989
990
+ The prime modulus P used for numeric hash scheme
991
+
992
+ .. attribute :: hash_info.inf
993
+
994
+ The hash value returned for a positive infinity
995
+
996
+ .. attribute :: hash_info.nan
997
+
998
+ (This attribute is no longer used)
999
+
1000
+ .. attribute :: hash_info.imag
1001
+
1002
+ The multiplier used for the imaginary part of a complex number
1003
+
1004
+ .. attribute :: hash_info.algorithm
1005
+
1006
+ The name of the algorithm for hashing of str, bytes, and memoryview
1007
+
1008
+ .. attribute :: hash_info.hash_bits
1009
+
1010
+ The internal output size of the hash algorithm
1011
+
1012
+ .. attribute :: hash_info.seed_bits
1013
+
1014
+ The size of the seed key of the hash algorithm
974
1015
975
1016
.. versionadded :: 3.2
976
1017
@@ -1048,32 +1089,31 @@ always available.
1048
1089
A :term: `named tuple ` that holds information about Python's internal
1049
1090
representation of integers. The attributes are read only.
1050
1091
1051
- .. tabularcolumns :: |l|L|
1052
-
1053
- +----------------------------------------+-----------------------------------------------+
1054
- | Attribute | Explanation |
1055
- +========================================+===============================================+
1056
- | :const: `bits_per_digit ` | number of bits held in each digit. Python |
1057
- | | integers are stored internally in base |
1058
- | | ``2**int_info.bits_per_digit `` |
1059
- +----------------------------------------+-----------------------------------------------+
1060
- | :const: `sizeof_digit ` | size in bytes of the C type used to |
1061
- | | represent a digit |
1062
- +----------------------------------------+-----------------------------------------------+
1063
- | :const: `default_max_str_digits ` | default value for |
1064
- | | :func: `sys.get_int_max_str_digits ` when it |
1065
- | | is not otherwise explicitly configured. |
1066
- +----------------------------------------+-----------------------------------------------+
1067
- | :const: `str_digits_check_threshold ` | minimum non-zero value for |
1068
- | | :func: `sys.set_int_max_str_digits `, |
1069
- | | :envvar: `PYTHONINTMAXSTRDIGITS `, or |
1070
- | | :option: `-X int_max_str_digits <-X> `. |
1071
- +----------------------------------------+-----------------------------------------------+
1092
+ .. attribute :: int_info.bits_per_digit
1093
+
1094
+ The number of bits held in each digit.
1095
+ Python integers are stored internally in base ``2**int_info.bits_per_digit ``.
1096
+
1097
+ .. attribute :: int_info.sizeof_digit
1098
+
1099
+ The size in bytes of the C type used to represent a digit.
1100
+
1101
+ .. attribute :: int_info.default_max_str_digits
1102
+
1103
+ The default value for :func: `sys.get_int_max_str_digits `
1104
+ when it is not otherwise explicitly configured.
1105
+
1106
+ .. attribute :: int_info.str_digits_check_threshold
1107
+
1108
+ The minimum non-zero value for :func: `sys.set_int_max_str_digits `,
1109
+ :envvar: `PYTHONINTMAXSTRDIGITS `, or :option: `-X int_max_str_digits <-X> `.
1072
1110
1073
1111
.. versionadded :: 3.1
1074
1112
1075
1113
.. versionchanged :: 3.11
1076
- Added ``default_max_str_digits `` and ``str_digits_check_threshold ``.
1114
+
1115
+ Added :attr: `~int_info.default_max_str_digits ` and
1116
+ :attr: `~int_info.str_digits_check_threshold `.
1077
1117
1078
1118
1079
1119
.. data :: __interactivehook__
@@ -1501,7 +1541,7 @@ always available.
1501
1541
:file: `Objects/lnotab_notes.txt ` for a detailed explanation of how this
1502
1542
works.
1503
1543
Per-line events may be disabled for a frame by setting
1504
- :attr: `f_trace_lines ` to :const: `False ` on that frame.
1544
+ :attr: `! f_trace_lines ` to :const: `False ` on that :ref: ` frame < frame-objects >` .
1505
1545
1506
1546
``'return' ``
1507
1547
A function (or other code block) is about to return. The local trace
@@ -1519,8 +1559,8 @@ always available.
1519
1559
opcode details). The local trace function is called; *arg * is
1520
1560
``None ``; the return value specifies the new local trace function.
1521
1561
Per-opcode events are not emitted by default: they must be explicitly
1522
- requested by setting :attr: `f_trace_opcodes ` to :const: `True ` on the
1523
- frame.
1562
+ requested by setting :attr: `! f_trace_opcodes ` to :const: `True ` on the
1563
+ :ref: ` frame < frame-objects >` .
1524
1564
1525
1565
Note that as an exception is propagated down the chain of callers, an
1526
1566
``'exception' `` event is generated at each level.
@@ -1549,8 +1589,8 @@ always available.
1549
1589
1550
1590
.. versionchanged :: 3.7
1551
1591
1552
- ``'opcode' `` event type added; :attr: `f_trace_lines ` and
1553
- :attr: `f_trace_opcodes ` attributes added to frames
1592
+ ``'opcode' `` event type added; :attr: `! f_trace_lines ` and
1593
+ :attr: `! f_trace_opcodes ` attributes added to frames
1554
1594
1555
1595
.. function :: set_asyncgen_hooks(firstiter, finalizer)
1556
1596
@@ -1675,7 +1715,7 @@ always available.
1675
1715
However, if you are writing a library (and do not control in which
1676
1716
context its code will be executed), be aware that the standard streams
1677
1717
may be replaced with file-like objects like :class: `io.StringIO ` which
1678
- do not support the :attr: ` ~io.BufferedIOBase. buffer ` attribute.
1718
+ do not support the :attr: ! buffer` attribute.
1679
1719
1680
1720
1681
1721
.. data :: __stdin__
@@ -1723,29 +1763,28 @@ always available.
1723
1763
A :term: `named tuple ` holding information about the thread
1724
1764
implementation.
1725
1765
1726
- .. tabularcolumns :: |l|p{0.7\linewidth}|
1727
-
1728
- +------------------+---------------------------------------------------------+
1729
- | Attribute | Explanation |
1730
- +==================+=========================================================+
1731
- | :const: `name ` | Name of the thread implementation: |
1732
- | | |
1733
- | | * ``'nt' ``: Windows threads |
1734
- | | * ``'pthread' ``: POSIX threads |
1735
- | | * ``'pthread-stubs' ``: stub POSIX threads |
1736
- | | (on WebAssembly platforms without threading support) |
1737
- | | * ``'solaris' ``: Solaris threads |
1738
- +------------------+---------------------------------------------------------+
1739
- | :const: `lock ` | Name of the lock implementation: |
1740
- | | |
1741
- | | * ``'semaphore' ``: a lock uses a semaphore |
1742
- | | * ``'mutex+cond' ``: a lock uses a mutex |
1743
- | | and a condition variable |
1744
- | | * ``None `` if this information is unknown |
1745
- +------------------+---------------------------------------------------------+
1746
- | :const: `version ` | Name and version of the thread library. It is a string, |
1747
- | | or ``None `` if this information is unknown. |
1748
- +------------------+---------------------------------------------------------+
1766
+ .. attribute :: thread_info.name
1767
+
1768
+ The name of the thread implementation:
1769
+
1770
+ * ``"nt" ``: Windows threads
1771
+ * ``"pthread" ``: POSIX threads
1772
+ * ``"pthread-stubs" ``: stub POSIX threads
1773
+ (on WebAssembly platforms without threading support)
1774
+ * ``"solaris" ``: Solaris threads
1775
+
1776
+ .. attribute :: thread_info.lock
1777
+
1778
+ The name of the lock implementation:
1779
+
1780
+ * ``"semaphore" ``: a lock uses a semaphore
1781
+ * ``"mutex+cond" ``: a lock uses a mutex and a condition variable
1782
+ * ``None `` if this information is unknown
1783
+
1784
+ .. attribute :: thread_info.version
1785
+
1786
+ The name and version of the thread library.
1787
+ It is a string, or ``None `` if this information is unknown.
1749
1788
1750
1789
.. versionadded :: 3.3
1751
1790
0 commit comments