Skip to content

Commit 95f2b61

Browse files
authored
Merge branch 'main' into has_header_false_neg_fix
2 parents 2092173 + da911a6 commit 95f2b61

File tree

123 files changed

+2944
-2613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+2944
-2613
lines changed

Doc/c-api/float.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.. _floatobjects:
44

55
Floating Point Objects
6-
----------------------
6+
======================
77

88
.. index:: pair: object; floating point
99

@@ -79,7 +79,7 @@ Floating Point Objects
7979
8080
8181
Pack and Unpack functions
82-
=========================
82+
-------------------------
8383
8484
The pack and unpack functions provide an efficient platform-independent way to
8585
store floating-point values as byte strings. The Pack routines produce a bytes
@@ -104,7 +104,7 @@ happens in such cases is partly accidental (alas).
104104
.. versionadded:: 3.11
105105
106106
Pack functions
107-
--------------
107+
^^^^^^^^^^^^^^
108108
109109
The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an
110110
:c:expr:`int` argument, non-zero if you want the bytes string in little-endian
@@ -135,7 +135,7 @@ There are two problems on non-IEEE platforms:
135135
136136
137137
Unpack functions
138-
----------------
138+
^^^^^^^^^^^^^^^^
139139
140140
The unpack routines read 2, 4 or 8 bytes, starting at *p*. *le* is an
141141
:c:expr:`int` argument, non-zero if the bytes string is in little-endian format

Doc/c-api/frame.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ See also :ref:`Reflection <reflection>`.
134134
135135
136136
Internal Frames
137-
---------------
137+
^^^^^^^^^^^^^^^
138138
139139
Unless using :pep:`523`, you will not need this.
140140

Doc/c-api/slice.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Slice Objects
113113
114114
115115
Ellipsis Object
116-
---------------
116+
^^^^^^^^^^^^^^^
117117
118118
119119
.. c:var:: PyObject *Py_Ellipsis

Doc/library/dis.rst

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,26 +1465,47 @@ iterations of the loop.
14651465
an argument from two-byte to four-byte.
14661466

14671467

1468-
.. opcode:: FORMAT_VALUE (flags)
1468+
.. opcode:: CONVERT_VALUE (oparg)
14691469

1470-
Used for implementing formatted literal strings (f-strings). Pops
1471-
an optional *fmt_spec* from the stack, then a required *value*.
1472-
*flags* is interpreted as follows:
1470+
Convert value to a string, depending on ``oparg``::
14731471

1474-
* ``(flags & 0x03) == 0x00``: *value* is formatted as-is.
1475-
* ``(flags & 0x03) == 0x01``: call :func:`str` on *value* before
1476-
formatting it.
1477-
* ``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before
1478-
formatting it.
1479-
* ``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before
1480-
formatting it.
1481-
* ``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use
1482-
it, else use an empty *fmt_spec*.
1472+
value = STACK.pop()
1473+
result = func(value)
1474+
STACK.push(result)
14831475

1484-
Formatting is performed using :c:func:`PyObject_Format`. The
1485-
result is pushed on the stack.
1476+
* ``oparg == 1``: call :func:`str` on *value*
1477+
* ``oparg == 2``: call :func:`repr` on *value*
1478+
* ``oparg == 3``: call :func:`ascii` on *value*
14861479

1487-
.. versionadded:: 3.6
1480+
Used for implementing formatted literal strings (f-strings).
1481+
1482+
.. versionadded:: 3.13
1483+
1484+
1485+
.. opcode:: FORMAT_SIMPLE
1486+
1487+
Formats the value on top of stack::
1488+
1489+
value = STACK.pop()
1490+
result = value.__format__("")
1491+
STACK.push(result)
1492+
1493+
Used for implementing formatted literal strings (f-strings).
1494+
1495+
.. versionadded:: 3.13
1496+
1497+
.. opcode:: FORMAT_SPEC
1498+
1499+
Formats the given value with the given format spec::
1500+
1501+
spec = STACK.pop()
1502+
value = STACK.pop()
1503+
result = value.__format__(spec)
1504+
STACK.push(result)
1505+
1506+
Used for implementing formatted literal strings (f-strings).
1507+
1508+
.. versionadded:: 3.13
14881509

14891510

14901511
.. opcode:: MATCH_CLASS (count)

0 commit comments

Comments
 (0)