Skip to content
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
4 changes: 2 additions & 2 deletions Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ an error value).

.. c:function:: int PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level, const char *format, ...)

Function similar to :c:func:`PyErr_WarnEx`, but use
Function similar to :c:func:`PyErr_WarnEx`, but uses
:c:func:`PyUnicode_FromFormat` to format the warning message. *format* is
an ASCII-encoded string.

Expand Down Expand Up @@ -1392,7 +1392,7 @@ Tracebacks

This function will return ``NULL`` on success, or an error message on error.

This function is meant to debug debug situations such as segfaults, fatal
This function is meant to debug situations such as segfaults, fatal
errors, and similar. It calls :c:func:`PyUnstable_DumpTraceback` for each
thread. It only writes the tracebacks of the first *max_threads* threads,
further output is truncated with the line ``...``. If *max_threads* is 0, the
Expand Down
2 changes: 1 addition & 1 deletion Doc/howto/a-conceptual-overview-of-asyncio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ The terms "coroutine function" and "coroutine object" are often conflated
as coroutine.
That can be confusing!
In this article, coroutine specifically refers to a coroutine object, or more
precisely, an instance of :data:`types.CoroutineType` (native coroutine).
precisely, an instance of :class:`types.CoroutineType` (native coroutine).
Note that coroutines can also exist as instances of
:class:`collections.abc.Coroutine` -- a distinction that matters for type
checking.
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A small number of constants live in the built-in namespace. They are:
An object frequently used to represent the absence of a value, as when
default arguments are not passed to a function. Assignments to ``None``
are illegal and raise a :exc:`SyntaxError`.
``None`` is the sole instance of the :data:`~types.NoneType` type.
``None`` is the sole instance of the :class:`~types.NoneType` type.


.. data:: NotImplemented
Expand All @@ -33,7 +33,7 @@ A small number of constants live in the built-in namespace. They are:
the other type; may be returned by the in-place binary special methods
(e.g. :meth:`~object.__imul__`, :meth:`~object.__iand__`, etc.) for the same purpose.
It should not be evaluated in a boolean context.
:data:`!NotImplemented` is the sole instance of the :data:`types.NotImplementedType` type.
:data:`!NotImplemented` is the sole instance of the :class:`types.NotImplementedType` type.

.. note::

Expand Down Expand Up @@ -68,7 +68,7 @@ A small number of constants live in the built-in namespace. They are:
The same as the ellipsis literal "``...``", an object frequently used to
indicate that something is omitted. Assignment to ``Ellipsis`` is possible, but
assignment to ``...`` raises a :exc:`SyntaxError`.
``Ellipsis`` is the sole instance of the :data:`types.EllipsisType` type.
``Ellipsis`` is the sole instance of the :class:`types.EllipsisType` type.


.. data:: __debug__
Expand Down
9 changes: 9 additions & 0 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,9 @@ Connection objects

See :ref:`sqlite3-howto-row-factory` for more details.

.. versionchanged:: next
Deleting the ``row_factory`` attribute is no longer allowed.

.. attribute:: text_factory

A :term:`callable` that accepts a :class:`bytes` parameter
Expand All @@ -1426,6 +1429,9 @@ Connection objects

See :ref:`sqlite3-howto-encoding` for more details.

.. versionchanged:: next
Deleting the ``text_factory`` attribute is no longer allowed.

.. attribute:: total_changes

Return the total number of database rows that have been modified, inserted, or
Expand Down Expand Up @@ -1709,6 +1715,9 @@ Cursor objects

See :ref:`sqlite3-howto-row-factory` for more details.

.. versionchanged:: next
Deleting the ``row_factory`` attribute is no longer allowed.


.. The sqlite3.Row example used to be a how-to. It has now been incorporated
into the Row reference. We keep the anchor here in order not to break
Expand Down
42 changes: 21 additions & 21 deletions Doc/library/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ If you instantiate any of these types, note that signatures may vary between Pyt

Standard names are defined for the following types:

.. data:: NoneType
.. class:: NoneType

The type of :data:`None`.

.. versionadded:: 3.10


.. data:: FunctionType
LambdaType
.. class:: FunctionType
LambdaType

The type of user-defined functions and functions created by
:keyword:`lambda` expressions.
Expand All @@ -162,21 +162,21 @@ Standard names are defined for the following types:
and is not raised for normal compilation.


.. data:: GeneratorType
.. class:: GeneratorType

The type of :term:`generator`-iterator objects, created by
generator functions.


.. data:: CoroutineType
.. class:: CoroutineType

The type of :term:`coroutine` objects, created by
:keyword:`async def` functions.

.. versionadded:: 3.5


.. data:: AsyncGeneratorType
.. class:: AsyncGeneratorType

The type of :term:`asynchronous generator`-iterator objects, created by
asynchronous generator functions.
Expand All @@ -196,58 +196,58 @@ 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.

.. data:: CellType
.. class:: CellType

The type for cell objects: such objects are used as containers for
a function's :term:`closure variables <closure variable>`.

.. versionadded:: 3.8


.. data:: MethodType
.. class:: MethodType

The type of methods of user-defined class instances.


.. data:: BuiltinFunctionType
BuiltinMethodType
.. class:: BuiltinFunctionType
BuiltinMethodType

The type of built-in functions like :func:`len` or :func:`sys.exit`, and
methods of built-in classes. (Here, the term "built-in" means "written in
C".)


.. data:: WrapperDescriptorType
.. class:: WrapperDescriptorType

The type of methods of some built-in data types and base classes such as
:meth:`object.__init__` or :meth:`object.__lt__`.

.. versionadded:: 3.7


.. data:: MethodWrapperType
.. class:: MethodWrapperType

The type of *bound* methods of some built-in data types and base classes.
For example it is the type of :code:`object().__str__`.

.. versionadded:: 3.7


.. data:: NotImplementedType
.. class:: NotImplementedType

The type of :data:`NotImplemented`.

.. versionadded:: 3.10


.. data:: MethodDescriptorType
.. class:: MethodDescriptorType

The type of methods of some built-in data types such as :meth:`str.join`.

.. versionadded:: 3.7


.. data:: ClassMethodDescriptorType
.. class:: ClassMethodDescriptorType

The type of *unbound* class methods of some built-in data types such as
``dict.__dict__['fromkeys']``.
Expand All @@ -273,7 +273,7 @@ Standard names are defined for the following types:
creating :class:`!ModuleType` instances which ensures the various
attributes are set appropriately.

.. data:: EllipsisType
.. class:: EllipsisType

The type of :data:`Ellipsis`.

Expand Down Expand Up @@ -327,13 +327,13 @@ Standard names are defined for the following types:
dynamically.


.. data:: FrameType
.. class:: FrameType

The type of :ref:`frame objects <frame-objects>` such as found in
:attr:`tb.tb_frame <traceback.tb_frame>` if ``tb`` is a traceback object.


.. data:: FrameLocalsProxyType
.. class:: FrameLocalsProxyType

The type of frame locals proxy objects, as found on the
:attr:`frame.f_locals` attribute.
Expand All @@ -343,7 +343,7 @@ Standard names are defined for the following types:
.. seealso:: :pep:`667`


.. data:: LazyImportType
.. class:: LazyImportType

The type of lazy import proxy objects. These objects are created when a
module is lazily imported and serve as placeholders until the module is
Expand All @@ -355,7 +355,7 @@ Standard names are defined for the following types:
.. seealso:: :pep:`810`


.. data:: GetSetDescriptorType
.. class:: GetSetDescriptorType

The type of objects defined in extension modules with ``PyGetSetDef``, such
as :attr:`FrameType.f_locals <frame.f_locals>` or ``array.array.typecode``.
Expand All @@ -364,7 +364,7 @@ Standard names are defined for the following types:
:class:`property` type, but for classes defined in extension modules.


.. data:: MemberDescriptorType
.. class:: MemberDescriptorType

The type of objects defined in extension modules with ``PyMemberDef``, such
as ``datetime.timedelta.days``. This type is used as descriptor for simple C
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2292,8 +2292,8 @@ without the dedicated syntax, as documented below.
* :data:`Concatenate`
* :ref:`annotating-callables`

.. data:: ParamSpecArgs
ParamSpecKwargs
.. class:: ParamSpecArgs
ParamSpecKwargs

Arguments and keyword arguments attributes of a :class:`ParamSpec`. The
``P.args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``,
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/weakref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -324,17 +324,17 @@ same issues as the :meth:`WeakKeyDictionary.keyrefs` method.
.. versionadded:: 3.4


.. data:: ReferenceType
.. class:: ReferenceType

The type object for weak references objects.


.. data:: ProxyType
.. class:: ProxyType

The type object for proxies of objects which are not callable.


.. data:: CallableProxyType
.. class:: CallableProxyType

The type object for proxies of callable objects.

Expand Down
6 changes: 3 additions & 3 deletions Doc/whatsnew/3.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1446,8 +1446,8 @@ as a positional-only argument.
types
-----

Reintroduce the :data:`types.EllipsisType`, :data:`types.NoneType`
and :data:`types.NotImplementedType` classes, providing a new set
Reintroduce the :class:`types.EllipsisType`, :class:`types.NoneType`
and :class:`types.NotImplementedType` classes, providing a new set
of types readily interpretable by type checkers.
(Contributed by Bas van Beek in :issue:`41810`.)

Expand Down Expand Up @@ -1928,7 +1928,7 @@ Changes in the Python API
(Contributed by Yurii Karabas, Andrew Svetlov, Yury Selivanov and Kyle Stanley
in :issue:`42392`.)

* The :data:`types.FunctionType` constructor now inherits the current builtins
* The :class:`types.FunctionType` constructor now inherits the current builtins
if the *globals* dictionary has no ``"__builtins__"`` key, rather than using
``{"None": None}`` as builtins: same behavior as :func:`eval` and
:func:`exec` functions. Defining a function with ``def function(...): ...``
Expand Down
4 changes: 2 additions & 2 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ eager:
import myapp.slow_module # lazy (matches filter)
import json # eager (does not match filter)

The proxy type itself is available as :data:`types.LazyImportType` for code
The proxy type itself is available as :class:`types.LazyImportType` for code
that needs to detect lazy imports programmatically.

There are some restrictions on where the ``lazy`` keyword can be used. Lazy
Expand Down Expand Up @@ -1661,7 +1661,7 @@ types
-----

* Expose the write-through :func:`locals` proxy type
as :data:`types.FrameLocalsProxyType`.
as :class:`types.FrameLocalsProxyType`.
This represents the type of the :attr:`frame.f_locals` attribute,
as described in :pep:`667`.

Expand Down
2 changes: 2 additions & 0 deletions Include/internal/pycore_import.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ extern PyObject * _PyImport_GetAbsName(
// Symbol is exported for the JIT on Windows builds.
PyAPI_FUNC(PyObject *) _PyImport_LoadLazyImportTstate(
PyThreadState *tstate, PyObject *lazy_import);
extern PyObject * _PyImport_TryLoadLazySubmodule(
PyObject *mod_name, PyObject *attr_name);
extern PyObject * _PyImport_LazyImportModuleLevelObject(
PyThreadState *tstate, PyObject *name, PyObject *builtins,
PyObject *globals, PyObject *locals, PyObject *fromlist, int level);
Expand Down
Loading
Loading