Skip to content

Commit b174aa5

Browse files
committed
Deploying to gh-pages from @ 302966f 🚀
1 parent 7106b97 commit b174aa5

File tree

565 files changed

+765
-662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

565 files changed

+765
-662
lines changed

_sources/c-api/function.rst.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ There are a few functions specific to Python functions.
9595
9696
.. versionadded:: 3.12
9797
98+
99+
.. c:function:: PyObject* PyFunction_GetKwDefaults(PyObject *op)
100+
101+
Return the keyword-only argument default values of the function object *op*. This can be a
102+
dictionary of arguments or ``NULL``.
103+
104+
98105
.. c:function:: PyObject* PyFunction_GetClosure(PyObject *op)
99106
100107
Return the closure associated with the function object *op*. This can be ``NULL``
@@ -123,6 +130,19 @@ There are a few functions specific to Python functions.
123130
Raises :exc:`SystemError` and returns ``-1`` on failure.
124131
125132
133+
.. c:function:: PyObject *PyFunction_GET_CODE(PyObject *op)
134+
PyObject *PyFunction_GET_GLOBALS(PyObject *op)
135+
PyObject *PyFunction_GET_MODULE(PyObject *op)
136+
PyObject *PyFunction_GET_DEFAULTS(PyObject *op)
137+
PyObject *PyFunction_GET_KW_DEFAULTS(PyObject *op)
138+
PyObject *PyFunction_GET_CLOSURE(PyObject *op)
139+
PyObject *PyFunction_GET_ANNOTATIONS(PyObject *op)
140+
141+
These functions are similar to their ``PyFunction_Get*`` counterparts, but
142+
do not do type checking. Passing anything other than an instance of
143+
:c:data:`PyFunction_Type` is undefined behavior.
144+
145+
126146
.. c:function:: int PyFunction_AddWatcher(PyFunction_WatchCallback callback)
127147
128148
Register *callback* as a function watcher for the current interpreter.

_sources/c-api/long.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
382382
All *n_bytes* of the buffer are written: large buffers are padded with
383383
zeroes.
384384
385-
If the returned value is greater than than *n_bytes*, the value was
385+
If the returned value is greater than *n_bytes*, the value was
386386
truncated: as many of the lowest bits of the value as could fit are written,
387387
and the higher bits are ignored. This matches the typical behavior
388388
of a C-style downcast.

_sources/howto/functional.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ generators:
602602
raise an exception inside the generator; the exception is raised by the
603603
``yield`` expression where the generator's execution is paused.
604604

605-
* :meth:`~generator.close` raises a :exc:`GeneratorExit` exception inside the
605+
* :meth:`~generator.close` sends a :exc:`GeneratorExit` exception to the
606606
generator to terminate the iteration. On receiving this exception, the
607607
generator's code must either raise :exc:`GeneratorExit` or
608608
:exc:`StopIteration`; catching the exception and doing anything else is

_sources/howto/isolating-extensions.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ Avoiding ``PyObject_New``
453453

454454
GC-tracked objects need to be allocated using GC-aware functions.
455455

456-
If you use use :c:func:`PyObject_New` or :c:func:`PyObject_NewVar`:
456+
If you use :c:func:`PyObject_New` or :c:func:`PyObject_NewVar`:
457457

458458
- Get and call type's :c:member:`~PyTypeObject.tp_alloc` slot, if possible.
459459
That is, replace ``TYPE *o = PyObject_New(TYPE, typeobj)`` with::

_sources/library/argparse.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ See also :ref:`specifying-ambiguous-arguments`. The supported values are:
862862

863863
.. index:: single: + (plus); in argparse module
864864

865-
* ``'+'``. Just like ``'*'``, all command-line args present are gathered into a
865+
* ``'+'``. Just like ``'*'``, all command-line arguments present are gathered into a
866866
list. Additionally, an error message will be generated if there wasn't at
867867
least one command-line argument present. For example::
868868

_sources/library/email.header.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ The :mod:`email.header` module also provides the following convenient functions.
206206

207207
.. note::
208208

209-
This function exists for for backwards compatibility only. For
209+
This function exists for backwards compatibility only. For
210210
new code, we recommend using :class:`email.headerregistry.HeaderRegistry`.
211211

212212

@@ -225,5 +225,5 @@ The :mod:`email.header` module also provides the following convenient functions.
225225

226226
.. note::
227227

228-
This function exists for for backwards compatibility only, and is
228+
This function exists for backwards compatibility only, and is
229229
not recommended for use in new code.

_sources/library/exceptions.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ their subgroups based on the types of the contained exceptions.
10381038
subclasses that need a different constructor signature need to
10391039
override that rather than :meth:`~object.__init__`. For example, the following
10401040
defines an exception group subclass which accepts an exit_code and
1041-
and constructs the group's message from it. ::
1041+
constructs the group's message from it. ::
10421042

10431043
class Errors(ExceptionGroup):
10441044
def __new__(cls, errors, exit_code):

_sources/library/functions.rst.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,15 +1827,15 @@ are always available. They are listed here in alphabetical order.
18271827
``range(start, stop, step)``. The *start* and *step* arguments default to
18281828
``None``.
18291829

1830+
Slice objects have read-only data attributes :attr:`!start`,
1831+
:attr:`!stop`, and :attr:`!step` which merely return the argument
1832+
values (or their default). They have no other explicit functionality;
1833+
however, they are used by NumPy and other third-party packages.
1834+
18301835
.. attribute:: slice.start
18311836
.. attribute:: slice.stop
18321837
.. attribute:: slice.step
18331838

1834-
Slice objects have read-only data attributes :attr:`!start`,
1835-
:attr:`!stop`, and :attr:`!step` which merely return the argument
1836-
values (or their default). They have no other explicit functionality;
1837-
however, they are used by NumPy and other third-party packages.
1838-
18391839
Slice objects are also generated when extended indexing syntax is used. For
18401840
example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See
18411841
:func:`itertools.islice` for an alternate version that returns an

_sources/library/logging.handlers.rst.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,15 @@ possible, while any potentially slow operations (such as sending an email via
10521052
.. note:: If you are using :mod:`multiprocessing`, you should avoid using
10531053
:class:`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`.
10541054

1055+
.. warning::
1056+
1057+
The :mod:`multiprocessing` module uses an internal logger created and
1058+
accessed via :meth:`~multiprocessing.get_logger`.
1059+
:class:`multiprocessing.Queue` will log ``DEBUG`` level messages upon
1060+
items being queued. If those log messages are processed by a
1061+
:class:`QueueHandler` using the same :class:`multiprocessing.Queue` instance,
1062+
it will cause a deadlock or infinite recursion.
1063+
10551064
.. method:: emit(record)
10561065

10571066
Enqueues the result of preparing the LogRecord. Should an exception

_sources/library/mmap.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
269269

270270
Resizing a map created with *access* of :const:`ACCESS_READ` or
271271
:const:`ACCESS_COPY`, will raise a :exc:`TypeError` exception.
272-
Resizing a map created with with *trackfd* set to ``False``,
272+
Resizing a map created with *trackfd* set to ``False``,
273273
will raise a :exc:`ValueError` exception.
274274

275275
**On Windows**: Resizing the map will raise an :exc:`OSError` if there are other

0 commit comments

Comments
 (0)