]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-115572: Move `codeobject.replace()` docs to the data model … (#115632)
authorKirill Podoprigora <kirill.bast9@mail.ru>
Sun, 18 Feb 2024 14:37:27 +0000 (17:37 +0300)
committerGitHub <noreply@github.com>
Sun, 18 Feb 2024 14:37:27 +0000 (14:37 +0000)
* [3.11] gh-115572: Move `codeobject.replace()` docs to the data model (GH-115631)
(cherry picked from commit 0c80da4c14d904a367968955544dd6ae58c8101c)

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>
Doc/library/types.rst
Doc/reference/datamodel.rst

index 4f468da8a1f6f608ccf1a0785d13954ce5d3eb34..9986ea328508d580e8364298f05e95589a9def01 100644 (file)
@@ -148,7 +148,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
 
@@ -156,12 +156,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.
-
-     .. versionadded:: 3.8
-
 .. data:: CellType
 
    The type for cell objects: such objects are used as containers for
index 72d91eb3326f5e4cf4da80ed9dbf202f2987014d..566ae03c410d875eca06369d3a9fff06feaf18e1 100644 (file)
@@ -1275,6 +1275,12 @@ 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.
+
+   .. versionadded:: 3.8
+
 
 .. _frame-objects: