Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion 8 Doc/library/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Standard names are defined for the following types:
.. versionadded:: 3.6


.. data:: CodeType
.. class:: CodeType(**kwargs)
Comment thread
asottile marked this conversation as resolved.
Outdated

.. index:: builtin: compile

Expand All @@ -143,6 +143,12 @@ Standard names are defined for the following types:
Note that the audited arguments may not match the names or positions
required by the initializer.

.. 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
Expand Down
4 changes: 2 additions & 2 deletions 4 Objects/clinic/codeobject.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions 4 Objects/codeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ code.replace
co_name: unicode(c_default="self->co_name") = None
co_lnotab: PyBytesObject(c_default="(PyBytesObject *)self->co_lnotab") = None

Return a new code object with new specified fields.
Return a copy of the code object with new values for the specified fields.
[clinic start generated code]*/

static PyObject *
Expand All @@ -622,7 +622,7 @@ code_replace_impl(PyCodeObject *self, int co_argcount,
PyObject *co_varnames, PyObject *co_freevars,
PyObject *co_cellvars, PyObject *co_filename,
PyObject *co_name, PyBytesObject *co_lnotab)
/*[clinic end generated code: output=25c8e303913bcace input=77189e46579ec426]*/
/*[clinic end generated code: output=25c8e303913bcace input=d9051bc8f24e6b28]*/
{
#define CHECK_INT_ARG(ARG) \
if (ARG < 0) { \
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.