]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-115572: Move `codeobject.replace()` docs to the data model (#115631)
authorDaler <48939169+daler-sz@users.noreply.github.com>
Sun, 18 Feb 2024 14:13:46 +0000 (19:13 +0500)
committerGitHub <noreply@github.com>
Sun, 18 Feb 2024 14:13:46 +0000 (14:13 +0000)
Doc/library/types.rst
Doc/reference/datamodel.rst

index c8c981024c1aeb11dd167ad49246de303b686db8..b856544e44207c567647b200cdc6c03b3c7f0df7 100644 (file)
@@ -188,7 +188,7 @@ Standard names are defined for the following types:
 
    .. index:: pair: built-in function; compile
 
-   The type for code objects such as returned by :func:`compile`.
+   The type of :ref:`code objects <code-objects>` such as returned by :func:`compile`.
 
    .. audit-event:: code.__new__ code,filename,name,argcount,posonlyargcount,kwonlyargcount,nlocals,stacksize,flags types.CodeType
 
@@ -196,14 +196,6 @@ Standard names are defined for the following types:
    required by the initializer.  The audit event only occurs for direct
    instantiation of code objects, and is not raised for normal compilation.
 
-   .. method:: CodeType.replace(**kwargs)
-
-     Return a copy of the code object with new values for the specified fields.
-
-     Code objects are also supported by generic function :func:`copy.replace`.
-
-     .. versionadded:: 3.8
-
 .. data:: CellType
 
    The type for cell objects: such objects are used as containers for
index 88bc025c7c3fb4dd815af06106c7776fcd4b6204..afeb6596fbb9787a52be06c38269120b7654a773 100644 (file)
@@ -1292,6 +1292,14 @@ Methods on code objects
       :pep:`626` - Precise line numbers for debugging and other tools.
          The PEP that introduced the :meth:`!co_lines` method.
 
+.. method:: codeobject.replace(**kwargs)
+
+   Return a copy of the code object with new values for the specified fields.
+
+   Code objects are also supported by the generic function :func:`copy.replace`.
+
+   .. versionadded:: 3.8
+
 
 .. _frame-objects: