Skip to content

Commit c69da47

Browse files
Eclips4daler-sz
andauthored
[3.11] gh-115572: Move codeobject.replace() docs to the data model … (#115632)
* [3.11] gh-115572: Move `codeobject.replace()` docs to the data model (GH-115631) (cherry picked from commit 0c80da4) Co-authored-by: Daler <[email protected]> * Remove note about copy.replace --------- Co-authored-by: Daler <[email protected]>
1 parent 9126232 commit c69da47

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Doc/library/types.rst

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

149149
.. index:: pair: built-in function; compile
150150

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

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

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

159-
.. method:: CodeType.replace(**kwargs)
160-
161-
Return a copy of the code object with new values for the specified fields.
162-
163-
.. versionadded:: 3.8
164-
165159
.. data:: CellType
166160

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

Doc/reference/datamodel.rst

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

1278+
.. method:: codeobject.replace(**kwargs)
1279+
1280+
Return a copy of the code object with new values for the specified fields.
1281+
1282+
.. versionadded:: 3.8
1283+
12781284

12791285
.. _frame-objects:
12801286

0 commit comments

Comments
 (0)