Skip to content

Commit ffe33e2

Browse files
committed
Deploying to gh-pages from @ c44666b 🚀
1 parent a7d4335 commit ffe33e2

File tree

542 files changed

+4717
-51391
lines changed

Some content is hidden

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

542 files changed

+4717
-51391
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 44c8d32fa1c843401cafd8ed3755058f
3+
config: 22b93d79a6e2b655281e07781f03cbb7
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_sources/c-api/memory.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,14 @@ The following type-oriented macros are provided for convenience. Note that
267267
.. c:macro:: PyMem_New(TYPE, n)
268268
269269
Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes of
270-
memory. Returns a pointer cast to :c:expr:`TYPE*`. The memory will not have
270+
memory. Returns a pointer cast to ``TYPE*``. The memory will not have
271271
been initialized in any way.
272272
273273
274274
.. c:macro:: PyMem_Resize(p, TYPE, n)
275275
276276
Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n *
277-
sizeof(TYPE))`` bytes. Returns a pointer cast to :c:expr:`TYPE*`. On return,
277+
sizeof(TYPE))`` bytes. Returns a pointer cast to ``TYPE*``. On return,
278278
*p* will be a pointer to the new memory area, or ``NULL`` in the event of
279279
failure.
280280

_sources/c-api/stable.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CPython's Application Binary Interface (ABI) is forward- and
1616
backwards-compatible across a minor release (if these are compiled the same
1717
way; see :ref:`stable-abi-platform` below).
1818
So, code compiled for Python 3.10.0 will work on 3.10.8 and vice versa,
19-
but will need to be compiled separately for 3.9.x and 3.10.x.
19+
but will need to be compiled separately for 3.9.x and 3.11.x.
2020

2121
There are two tiers of C API with different stability expectations:
2222

_sources/c-api/structures.rst.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,40 @@ definition with the same method name.
399399
slot. This is helpful because calls to PyCFunctions are optimized more
400400
than wrapper object calls.
401401
402+
.. c:function:: PyObject * PyCMethod_New(PyMethodDef *ml, PyObject *self, PyObject *module, PyTypeObject *cls)
403+
404+
Turn *ml* into a Python :term:`callable` object.
405+
The caller must ensure that *ml* outlives the :term:`callable`.
406+
Typically, *ml* is defined as a static variable.
407+
408+
The *self* parameter will be passed as the *self* argument
409+
to the C function in ``ml->ml_meth`` when invoked.
410+
*self* can be ``NULL``.
411+
412+
The :term:`callable` object's ``__module__`` attribute
413+
can be set from the given *module* argument.
414+
*module* should be a Python string,
415+
which will be used as name of the module the function is defined in.
416+
If unavailable, it can be set to :const:`None` or ``NULL``.
417+
418+
.. seealso:: :attr:`function.__module__`
419+
420+
The *cls* parameter will be passed as the *defining_class*
421+
argument to the C function.
422+
Must be set if :c:macro:`METH_METHOD` is set on ``ml->ml_flags``.
423+
424+
.. versionadded:: 3.9
425+
426+
427+
.. c:function:: PyObject * PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module)
428+
429+
Equivalent to ``PyCMethod_New(ml, self, module, NULL)``.
430+
431+
432+
.. c:function:: PyObject * PyCFunction_New(PyMethodDef *ml, PyObject *self)
433+
434+
Equivalent to ``PyCMethod_New(ml, self, NULL, NULL)``.
435+
402436
403437
Accessing attributes of extension types
404438
---------------------------------------

_sources/library/array.rst.txt

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,16 @@ The module defines the following type:
7676
.. class:: array(typecode[, initializer])
7777

7878
A new array whose items are restricted by *typecode*, and initialized
79-
from the optional *initializer* value, which must be a list, a
80-
:term:`bytes-like object`, or iterable over elements of the
81-
appropriate type.
79+
from the optional *initializer* value, which must be a :class:`bytes`
80+
or :class:`bytearray` object, a Unicode string, or iterable over elements
81+
of the appropriate type.
8282

83-
If given a list or string, the initializer is passed to the new array's
84-
:meth:`fromlist`, :meth:`frombytes`, or :meth:`fromunicode` method (see below)
85-
to add initial items to the array. Otherwise, the iterable initializer is
86-
passed to the :meth:`extend` method.
83+
If given a :class:`bytes` or :class:`bytearray` object, the initializer
84+
is passed to the new array's :meth:`frombytes` method;
85+
if given a Unicode string, the initializer is passed to the
86+
:meth:`fromunicode` method;
87+
otherwise, the initializer's iterator is passed to the :meth:`extend` method
88+
to add initial items to the array.
8789

8890
Array objects support the ordinary sequence operations of indexing, slicing,
8991
concatenation, and multiplication. When using slice assignment, the assigned
@@ -149,10 +151,11 @@ The module defines the following type:
149151
must be the right type to be appended to the array.
150152

151153

152-
.. method:: frombytes(s)
154+
.. method:: frombytes(buffer)
153155

154-
Appends items from the string, interpreting the string as an array of machine
155-
values (as if it had been read from a file using the :meth:`fromfile` method).
156+
Appends items from the :term:`bytes-like object`, interpreting
157+
its content as an array of machine values (as if it had been read
158+
from a file using the :meth:`fromfile` method).
156159

157160
.. versionadded:: 3.2
158161
:meth:`!fromstring` is renamed to :meth:`frombytes` for clarity.
@@ -174,9 +177,9 @@ The module defines the following type:
174177

175178
.. method:: fromunicode(s)
176179

177-
Extends this array with data from the given unicode string. The array must
178-
be a type ``'u'`` array; otherwise a :exc:`ValueError` is raised. Use
179-
``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to an
180+
Extends this array with data from the given Unicode string.
181+
The array must have type code ``'u'``; otherwise a :exc:`ValueError` is raised.
182+
Use ``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to an
180183
array of some other type.
181184

182185

@@ -236,23 +239,27 @@ The module defines the following type:
236239

237240
.. method:: tounicode()
238241

239-
Convert the array to a unicode string. The array must be a type ``'u'`` array;
242+
Convert the array to a Unicode string. The array must have a type ``'u'``;
240243
otherwise a :exc:`ValueError` is raised. Use ``array.tobytes().decode(enc)`` to
241-
obtain a unicode string from an array of some other type.
244+
obtain a Unicode string from an array of some other type.
242245

243246

244-
When an array object is printed or converted to a string, it is represented as
245-
``array(typecode, initializer)``. The *initializer* is omitted if the array is
246-
empty, otherwise it is a string if the *typecode* is ``'u'``, otherwise it is a
247-
list of numbers. The string is guaranteed to be able to be converted back to an
247+
The string representation of array objects has the form
248+
``array(typecode, initializer)``.
249+
The *initializer* is omitted if the array is empty, otherwise it is
250+
a Unicode string if the *typecode* is ``'u'``, otherwise it is
251+
a list of numbers.
252+
The string representation is guaranteed to be able to be converted back to an
248253
array with the same type and value using :func:`eval`, so long as the
249254
:class:`~array.array` class has been imported using ``from array import array``.
255+
Variables ``inf`` and ``nan`` must also be defined if it contains
256+
corresponding floating point values.
250257
Examples::
251258

252259
array('l')
253260
array('u', 'hello \u2641')
254261
array('l', [1, 2, 3, 4, 5])
255-
array('d', [1.0, 2.0, 3.14])
262+
array('d', [1.0, 2.0, 3.14, -inf, nan])
256263

257264

258265
.. seealso::

_sources/library/doctest.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ That's all you need to know to start making productive use of :mod:`doctest`!
134134
Jump in. The following sections provide full details. Note that there are many
135135
examples of doctests in the standard Python test suite and libraries.
136136
Especially useful examples can be found in the standard test file
137-
:file:`Lib/test/test_doctest.py`.
137+
:file:`Lib/test/test_doctest/test_doctest.py`.
138138

139139

140140
.. _doctest-simple-testmod:

_sources/library/email.message.rst.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ over the object tree.
4040
The :class:`EmailMessage` dictionary-like interface is indexed by the header
4141
names, which must be ASCII values. The values of the dictionary are strings
4242
with some extra methods. Headers are stored and returned in case-preserving
43-
form, but field names are matched case-insensitively. Unlike a real dict,
44-
there is an ordering to the keys, and there can be duplicate keys. Additional
45-
methods are provided for working with headers that have duplicate keys.
43+
form, but field names are matched case-insensitively. The keys are ordered,
44+
but unlike a real dict, there can be duplicates. Addtional methods are
45+
provided for working with headers that have duplicate keys.
4646

4747
The *payload* is either a string or bytes object, in the case of simple message
4848
objects, or a list of :class:`EmailMessage` objects, for MIME container

_sources/library/enum.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ Utilities and Decorators
820820

821821
* ``FIRST = auto()`` will work (auto() is replaced with ``1``);
822822
* ``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` is
823-
used to create the ``SECOND`` enum member;
823+
used to create the ``SECOND`` enum member;
824824
* ``THREE = [auto(), -3]`` will *not* work (``<auto instance>, -3`` is used to
825825
create the ``THREE`` enum member)
826826

0 commit comments

Comments
 (0)