Skip to content

Commit

Permalink
Merge branch 'main' into pythongh-100479-add-makepath-redux
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed May 5, 2023
2 parents 961e2bf + b979741 commit 39297cf
Show file tree
Hide file tree
Showing 258 changed files with 8,613 additions and 5,263 deletions.
2 changes: 1 addition & 1 deletion Doc/c-api/bytearray.rst
Expand Up @@ -5,7 +5,7 @@
Byte Array Objects
------------------

.. index:: object: bytearray
.. index:: pair: object; bytearray


.. c:type:: PyByteArrayObject
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/bytes.rst
Expand Up @@ -8,7 +8,7 @@ Bytes Objects
These functions raise :exc:`TypeError` when expecting a bytes parameter and
called with a non-bytes parameter.

.. index:: object: bytes
.. index:: pair: object; bytes


.. c:type:: PyBytesObject
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/capsule.rst
Expand Up @@ -5,7 +5,7 @@
Capsules
--------

.. index:: object: Capsule
.. index:: pair: object; Capsule

Refer to :ref:`using-capsules` for more information on using these objects.

Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/complex.rst
Expand Up @@ -5,7 +5,7 @@
Complex Number Objects
----------------------

.. index:: object: complex number
.. index:: pair: object; complex number

Python's complex number objects are implemented as two distinct types when
viewed from the C API: one is the Python object exposed to Python programs, and
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/concrete.rst
Expand Up @@ -40,7 +40,7 @@ This section describes Python type objects and the singleton object ``None``.
Numeric Objects
===============

.. index:: object: numeric
.. index:: pair: object; numeric

.. toctree::

Expand All @@ -55,7 +55,7 @@ Numeric Objects
Sequence Objects
================

.. index:: object: sequence
.. index:: pair: object; sequence

Generic operations on sequence objects were discussed in the previous chapter;
this section deals with the specific kinds of sequence objects that are
Expand All @@ -77,7 +77,7 @@ intrinsic to the Python language.
Container Objects
=================

.. index:: object: mapping
.. index:: pair: object; mapping

.. toctree::

Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/dict.rst
Expand Up @@ -5,7 +5,7 @@
Dictionary Objects
------------------

.. index:: object: dictionary
.. index:: pair: object; dictionary


.. c:type:: PyDictObject
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/exceptions.rst
Expand Up @@ -602,7 +602,7 @@ Signal Handling
.. c:function:: int PyErr_CheckSignals()
.. index::
module: signal
pair: module; signal
single: SIGINT
single: KeyboardInterrupt (built-in exception)
Expand Down Expand Up @@ -633,7 +633,7 @@ Signal Handling
.. c:function:: void PyErr_SetInterrupt()
.. index::
module: signal
pair: module; signal
single: SIGINT
single: KeyboardInterrupt (built-in exception)
Expand All @@ -648,7 +648,7 @@ Signal Handling
.. c:function:: int PyErr_SetInterruptEx(int signum)
.. index::
module: signal
pair: module; signal
single: KeyboardInterrupt (built-in exception)
Simulate the effect of a signal arriving. The next time
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/file.rst
Expand Up @@ -5,7 +5,7 @@
File Objects
------------

.. index:: object: file
.. index:: pair: object; file

These APIs are a minimal emulation of the Python 2 C API for built-in file
objects, which used to rely on the buffered I/O (:c:expr:`FILE*`) support
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/float.rst
Expand Up @@ -5,7 +5,7 @@
Floating Point Objects
----------------------

.. index:: object: floating point
.. index:: pair: object; floating point


.. c:type:: PyFloatObject
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/function.rst
Expand Up @@ -5,7 +5,7 @@
Function Objects
----------------

.. index:: object: function
.. index:: pair: object; function

There are a few functions specific to Python functions.

Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/import.rst
Expand Up @@ -186,10 +186,10 @@ Importing Modules
.. versionadded:: 3.2
.. versionchanged:: 3.3
Uses :func:`imp.source_from_cache()` in calculating the source path if
Uses :func:`!imp.source_from_cache()` in calculating the source path if
only the bytecode path is provided.
.. versionchanged:: 3.12
No longer uses the removed ``imp`` module.
No longer uses the removed :mod:`!imp` module.
.. c:function:: long PyImport_GetMagicNumber()
Expand Down
14 changes: 7 additions & 7 deletions Doc/c-api/init.rst
Expand Up @@ -336,9 +336,9 @@ Initializing and finalizing the interpreter
single: PyEval_InitThreads()
single: modules (in module sys)
single: path (in module sys)
module: builtins
module: __main__
module: sys
pair: module; builtins
pair: module; __main__
pair: module; sys
triple: module; search; path
single: PySys_SetArgv()
single: PySys_SetArgvEx()
Expand Down Expand Up @@ -1051,7 +1051,7 @@ code, or when embedding the Python interpreter:
.. deprecated:: 3.9
.. index:: module: _thread
.. index:: pair: module; _thread
.. c:function:: int PyEval_ThreadsInitialized()
Expand Down Expand Up @@ -1494,9 +1494,9 @@ function. You can create and destroy them using the following functions:
.. c:function:: PyThreadState* Py_NewInterpreter()
.. index::
module: builtins
module: __main__
module: sys
pair: module; builtins
pair: module; __main__
pair: module; sys
single: stdout (in module sys)
single: stderr (in module sys)
single: stdin (in module sys)
Expand Down
8 changes: 4 additions & 4 deletions Doc/c-api/intro.rst
Expand Up @@ -261,7 +261,7 @@ complete listing.
Objects, Types and Reference Counts
===================================

.. index:: object: type
.. index:: pair: object; type

Most Python/C API functions have one or more arguments as well as a return value
of type :c:expr:`PyObject*`. This type is a pointer to an opaque data type
Expand Down Expand Up @@ -705,9 +705,9 @@ interpreter can only be used after the interpreter has been initialized.

.. index::
single: Py_Initialize()
module: builtins
module: __main__
module: sys
pair: module; builtins
pair: module; __main__
pair: module; sys
triple: module; search; path
single: path (in module sys)

Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/list.rst
Expand Up @@ -5,7 +5,7 @@
List Objects
------------

.. index:: object: list
.. index:: pair: object; list


.. c:type:: PyListObject
Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/long.rst
Expand Up @@ -5,8 +5,8 @@
Integer Objects
---------------

.. index:: object: long integer
object: integer
.. index:: pair: object; long integer
pair: object; integer

All integers are implemented as "long" integer objects of arbitrary size.

Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/memoryview.rst
Expand Up @@ -3,7 +3,7 @@
.. _memoryview-objects:

.. index::
object: memoryview
pair: object; memoryview

MemoryView objects
------------------
Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/method.rst
Expand Up @@ -5,7 +5,7 @@
Instance Method Objects
-----------------------

.. index:: object: instancemethod
.. index:: pair: object; instancemethod

An instance method is a wrapper for a :c:data:`PyCFunction` and the new way
to bind a :c:data:`PyCFunction` to a class object. It replaces the former call
Expand Down Expand Up @@ -47,7 +47,7 @@ to bind a :c:data:`PyCFunction` to a class object. It replaces the former call
Method Objects
--------------
.. index:: object: method
.. index:: pair: object; method
Methods are bound function objects. Methods are always bound to an instance of
a user-defined class. Unbound methods (methods bound to a class object) are
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/module.rst
Expand Up @@ -5,7 +5,7 @@
Module Objects
--------------

.. index:: object: module
.. index:: pair: object; module


.. c:var:: PyTypeObject PyModule_Type
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/none.rst
Expand Up @@ -5,7 +5,7 @@
The ``None`` Object
-------------------

.. index:: object: None
.. index:: pair: object; None

Note that the :c:type:`PyTypeObject` for ``None`` is not directly exposed in the
Python/C API. Since ``None`` is a singleton, testing for object identity (using
Expand Down
39 changes: 39 additions & 0 deletions Doc/c-api/object.rst
Expand Up @@ -395,3 +395,42 @@ Object Protocol
returns ``NULL`` if the object cannot be iterated.
.. versionadded:: 3.10
.. c:function:: void *PyObject_GetTypeData(PyObject *o, PyTypeObject *cls)
Get a pointer to subclass-specific data reserved for *cls*.
The object *o* must be an instance of *cls*, and *cls* must have been
created using negative :c:member:`PyType_Spec.basicsize`.
Python does not check this.
On error, set an exception and return ``NULL``.
.. versionadded:: 3.12
.. c:function:: Py_ssize_t PyType_GetTypeDataSize(PyTypeObject *cls)
Return the size of the instance memory space reserved for *cls*, i.e. the size of the
memory :c:func:`PyObject_GetTypeData` returns.
This may be larger than requested using :c:member:`-PyType_Spec.basicsize <PyType_Spec.basicsize>`;
it is safe to use this larger size (e.g. with :c:func:`!memset`).
The type *cls* **must** have been created using
negative :c:member:`PyType_Spec.basicsize`.
Python does not check this.
On error, set an exception and return a negative value.
.. versionadded:: 3.12
.. c:function:: void *PyObject_GetItemData(PyObject *o)
Get a pointer to per-item data for a class with
:const:`Py_TPFLAGS_ITEMS_AT_END`.
On error, set an exception and return ``NULL``.
:py:exc:`TypeError` is raised if *o* does not have
:const:`Py_TPFLAGS_ITEMS_AT_END` set.
.. versionadded:: 3.12
4 changes: 2 additions & 2 deletions Doc/c-api/set.rst
Expand Up @@ -9,8 +9,8 @@ Set Objects


.. index::
object: set
object: frozenset
pair: object; set
pair: object; frozenset

This section details the public API for :class:`set` and :class:`frozenset`
objects. Any functionality not listed below is best accessed using either
Expand Down
16 changes: 16 additions & 0 deletions Doc/c-api/structures.rst
Expand Up @@ -486,6 +486,22 @@ The following flags can be used with :c:member:`PyMemberDef.flags`:
Emit an ``object.__getattr__`` :ref:`audit event <audit-events>`
before reading.
.. c:macro:: Py_RELATIVE_OFFSET
Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef``
entry indicates an offset from the subclass-specific data, rather than
from ``PyObject``.
Can only be used as part of :c:member:`Py_tp_members <PyTypeObject.tp_members>`
:c:type:`slot <PyTypeSlot>` when creating a class using negative
:c:member:`~PyTypeDef.basicsize`.
It is mandatory in that case.
This flag is only used in :c:type:`PyTypeSlot`.
When setting :c:member:`~PyTypeObject.tp_members` during
class creation, Python clears it and sets
:c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct.
.. index::
single: READ_RESTRICTED
single: WRITE_RESTRICTED
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/tuple.rst
Expand Up @@ -5,7 +5,7 @@
Tuple Objects
-------------

.. index:: object: tuple
.. index:: pair: object; tuple


.. c:type:: PyTupleObject
Expand Down

0 comments on commit 39297cf

Please sign in to comment.