Skip to content

Commit ae6c01d

Browse files
Eclips4daler-sz
andauthored
[3.12] gh-115572: Move codeobject.replace() docs to the data model … (#115633)
* [3.12] gh-115572: Move `codeobject.replace()` docs to the data model (GH-115631) (cherry picked from commit 0c80da4) Co-authored-by: Daler <48939169+daler-sz@users.noreply.github.com> * Remove note about copy.replace --------- Co-authored-by: Daler <48939169+daler-sz@users.noreply.github.com>
1 parent dd961d8 commit ae6c01d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: Doc/library/types.rst

+1-7
Original file line numberDiff line numberDiff line change
@@ -188,20 +188,14 @@ Standard names are defined for the following types:
188188

189189
.. index:: pair: built-in function; compile
190190

191-
The type for code objects such as returned by :func:`compile`.
191+
The type of :ref:`code objects <code-objects>` such as returned by :func:`compile`.
192192

193193
.. audit-event:: code.__new__ code,filename,name,argcount,posonlyargcount,kwonlyargcount,nlocals,stacksize,flags types.CodeType
194194

195195
Note that the audited arguments may not match the names or positions
196196
required by the initializer. The audit event only occurs for direct
197197
instantiation of code objects, and is not raised for normal compilation.
198198

199-
.. method:: CodeType.replace(**kwargs)
200-
201-
Return a copy of the code object with new values for the specified fields.
202-
203-
.. versionadded:: 3.8
204-
205199
.. data:: CellType
206200

207201
The type for cell objects: such objects are used as containers for

Diff for: Doc/reference/datamodel.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,12 @@ Methods on code objects
12921292
:pep:`626` - Precise line numbers for debugging and other tools.
12931293
The PEP that introduced the :meth:`!co_lines` method.
12941294

1295+
.. method:: codeobject.replace(**kwargs)
1296+
1297+
Return a copy of the code object with new values for the specified fields.
1298+
1299+
.. versionadded:: 3.8
1300+
12951301

12961302
.. _frame-objects:
12971303

0 commit comments

Comments
 (0)