Skip to content

Commit e254ace

Browse files
committed
Deploying to gh-pages from @ aa8e180 🚀
1 parent 0af3b2c commit e254ace

File tree

575 files changed

+5904
-5378
lines changed

Some content is hidden

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

575 files changed

+5904
-5378
lines changed

_sources/c-api/arg.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Parsing arguments and building values
66
=====================================
77

8-
These functions are useful when creating your own extensions functions and
8+
These functions are useful when creating your own extension functions and
99
methods. Additional information and examples are available in
1010
:ref:`extending-index`.
1111

_sources/c-api/module.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ The available slot types are:
415415
in one module definition.
416416
417417
If ``Py_mod_multiple_interpreters`` is not specified, the import
418-
machinery defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``.
418+
machinery defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``.
419419
420420
.. versionadded:: 3.12
421421

_sources/c-api/unicode.rst.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,15 @@ APIs:
607607
decref'ing the returned objects.
608608
609609
610+
.. c:function:: const char* PyUnicode_GetDefaultEncoding(void)
611+
612+
Return the name of the default string encoding, ``"utf-8"``.
613+
See :func:`sys.getdefaultencoding`.
614+
615+
The returned string does not need to be freed, and is valid
616+
until interpreter shutdown.
617+
618+
610619
.. c:function:: Py_ssize_t PyUnicode_GetLength(PyObject *unicode)
611620
612621
Return the length of the Unicode object, in code points.

_sources/deprecations/pending-removal-in-3.15.rst.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ Pending Removal in Python 3.15
5555
This function is only useful for Jython support, has a confusing API,
5656
and is largely untested.
5757

58+
* :mod:`sysconfig`:
59+
60+
* The *check_home* argument of :func:`sysconfig.is_python_build` has been
61+
deprecated since Python 3.12.
62+
5863
* :mod:`threading`:
5964

6065
* :func:`~threading.RLock` will take no arguments in Python 3.15.

_sources/deprecations/pending-removal-in-future.rst.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ although there is currently no date scheduled for their removal.
105105
* ``ssl.TLSVersion.TLSv1``
106106
* ``ssl.TLSVersion.TLSv1_1``
107107

108-
* :func:`sysconfig.is_python_build` *check_home* parameter is deprecated and
109-
ignored.
110-
111108
* :mod:`threading` methods:
112109

113110
* :meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition.notify_all`.

_sources/glossary.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ Glossary
706706
iterables include all sequence types (such as :class:`list`, :class:`str`,
707707
and :class:`tuple`) and some non-sequence types like :class:`dict`,
708708
:term:`file objects <file object>`, and objects of any classes you define
709-
with an :meth:`~iterator.__iter__` method or with a
709+
with an :meth:`~object.__iter__` method or with a
710710
:meth:`~object.__getitem__` method
711711
that implements :term:`sequence` semantics.
712712

_sources/library/abc.rst.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,18 @@ a helper class :class:`ABC` to alternatively define ABCs through inheritance:
141141
MyIterable.register(Foo)
142142

143143
The ABC ``MyIterable`` defines the standard iterable method,
144-
:meth:`~iterator.__iter__`, as an abstract method. The implementation given
144+
:meth:`~object.__iter__`, as an abstract method. The implementation given
145145
here can still be called from subclasses. The :meth:`!get_iterator` method
146146
is also part of the ``MyIterable`` abstract base class, but it does not have
147147
to be overridden in non-abstract derived classes.
148148

149149
The :meth:`__subclasshook__` class method defined here says that any class
150-
that has an :meth:`~iterator.__iter__` method in its
150+
that has an :meth:`~object.__iter__` method in its
151151
:attr:`~object.__dict__` (or in that of one of its base classes, accessed
152152
via the :attr:`~type.__mro__` list) is considered a ``MyIterable`` too.
153153

154154
Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``,
155-
even though it does not define an :meth:`~iterator.__iter__` method (it uses
155+
even though it does not define an :meth:`~object.__iter__` method (it uses
156156
the old-style iterable protocol, defined in terms of :meth:`~object.__len__` and
157157
:meth:`~object.__getitem__`). Note that this will not make ``get_iterator``
158158
available as a method of ``Foo``, so it is provided separately.

_sources/library/collections.rst.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,8 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,
748748
returns or raises is then returned or raised by :meth:`~object.__getitem__`.
749749

750750
Note that :meth:`__missing__` is *not* called for any operations besides
751-
:meth:`~object.__getitem__`. This means that :meth:`get` will, like normal
752-
dictionaries, return ``None`` as a default rather than using
751+
:meth:`~object.__getitem__`. This means that :meth:`~dict.get` will, like
752+
normal dictionaries, return ``None`` as a default rather than using
753753
:attr:`default_factory`.
754754

755755

@@ -849,8 +849,9 @@ they add the ability to access fields by name instead of position index.
849849
Returns a new tuple subclass named *typename*. The new subclass is used to
850850
create tuple-like objects that have fields accessible by attribute lookup as
851851
well as being indexable and iterable. Instances of the subclass also have a
852-
helpful docstring (with typename and field_names) and a helpful :meth:`__repr__`
853-
method which lists the tuple contents in a ``name=value`` format.
852+
helpful docstring (with *typename* and *field_names*) and a helpful
853+
:meth:`~object.__repr__` method which lists the tuple contents in a ``name=value``
854+
format.
854855

855856
The *field_names* are a sequence of strings such as ``['x', 'y']``.
856857
Alternatively, *field_names* can be a single string with each fieldname
@@ -894,10 +895,10 @@ they add the ability to access fields by name instead of position index.
894895
Added the *module* parameter.
895896

896897
.. versionchanged:: 3.7
897-
Removed the *verbose* parameter and the :attr:`_source` attribute.
898+
Removed the *verbose* parameter and the :attr:`!_source` attribute.
898899

899900
.. versionchanged:: 3.7
900-
Added the *defaults* parameter and the :attr:`_field_defaults`
901+
Added the *defaults* parameter and the :attr:`~somenamedtuple._field_defaults`
901902
attribute.
902903

903904
.. doctest::
@@ -1109,7 +1110,7 @@ Some differences from :class:`dict` still remain:
11091110
A regular :class:`dict` can emulate the order sensitive equality test with
11101111
``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``.
11111112

1112-
* The :meth:`popitem` method of :class:`OrderedDict` has a different
1113+
* The :meth:`~OrderedDict.popitem` method of :class:`OrderedDict` has a different
11131114
signature. It accepts an optional argument to specify which item is popped.
11141115

11151116
A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=True)``
@@ -1119,7 +1120,7 @@ Some differences from :class:`dict` still remain:
11191120
with ``(k := next(iter(d)), d.pop(k))`` which will return and remove the
11201121
leftmost (first) item if it exists.
11211122

1122-
* :class:`OrderedDict` has a :meth:`move_to_end` method to efficiently
1123+
* :class:`OrderedDict` has a :meth:`~OrderedDict.move_to_end` method to efficiently
11231124
reposition an element to an endpoint.
11241125

11251126
A regular :class:`dict` can emulate OrderedDict's ``od.move_to_end(k,
@@ -1130,7 +1131,7 @@ Some differences from :class:`dict` still remain:
11301131
OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key
11311132
and its associated value to the leftmost (first) position.
11321133

1133-
* Until Python 3.8, :class:`dict` lacked a :meth:`__reversed__` method.
1134+
* Until Python 3.8, :class:`dict` lacked a :meth:`~object.__reversed__` method.
11341135

11351136

11361137
.. class:: OrderedDict([items])
@@ -1185,7 +1186,7 @@ anywhere a regular dictionary is used.
11851186

11861187
.. versionchanged:: 3.6
11871188
With the acceptance of :pep:`468`, order is retained for keyword arguments
1188-
passed to the :class:`OrderedDict` constructor and its :meth:`update`
1189+
passed to the :class:`OrderedDict` constructor and its :meth:`~dict.update`
11891190
method.
11901191

11911192
.. versionchanged:: 3.9

_sources/library/constants.rst.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ A small number of constants live in the built-in namespace. They are:
4646

4747
See :ref:`implementing-the-arithmetic-operations` for examples.
4848

49-
.. note::
49+
.. caution::
5050

51-
``NotImplementedError`` and :data:`!NotImplemented` are not interchangeable,
52-
even though they have similar names and purposes.
53-
See :exc:`NotImplementedError` for details on when to use it.
51+
:data:`!NotImplemented` and :exc:`!NotImplementedError` are not
52+
interchangeable. This constant should only be used as described
53+
above; see :exc:`NotImplementedError` for details on correct usage
54+
of the exception.
5455

5556
.. versionchanged:: 3.9
5657
Evaluating :data:`!NotImplemented` in a boolean context is deprecated. While

_sources/library/email.errors.rst.txt

Lines changed: 59 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,12 @@ The following exception classes are defined in the :mod:`email.errors` module:
4545

4646
.. exception:: MultipartConversionError()
4747

48-
Raised when a payload is added to a :class:`~email.message.Message` object
49-
using :meth:`add_payload`, but the payload is already a scalar and the
50-
message's :mailheader:`Content-Type` main type is not either
51-
:mimetype:`multipart` or missing. :exc:`MultipartConversionError` multiply
52-
inherits from :exc:`MessageError` and the built-in :exc:`TypeError`.
53-
54-
Since :meth:`Message.add_payload` is deprecated, this exception is rarely
55-
raised in practice. However the exception may also be raised if the
56-
:meth:`~email.message.Message.attach`
57-
method is called on an instance of a class derived from
48+
Raised if the :meth:`~email.message.Message.attach` method is called
49+
on an instance of a class derived from
5850
:class:`~email.mime.nonmultipart.MIMENonMultipart` (e.g.
5951
:class:`~email.mime.image.MIMEImage`).
52+
:exc:`MultipartConversionError` multiply
53+
inherits from :exc:`MessageError` and the built-in :exc:`TypeError`.
6054

6155

6256
.. exception:: HeaderWriteError()
@@ -83,51 +77,72 @@ object would have a defect, but the containing messages would not.
8377

8478
All defect classes are subclassed from :class:`email.errors.MessageDefect`.
8579

86-
* :class:`NoBoundaryInMultipartDefect` -- A message claimed to be a multipart,
87-
but had no :mimetype:`boundary` parameter.
80+
.. exception:: NoBoundaryInMultipartDefect
81+
82+
A message claimed to be a multipart, but had no :mimetype:`boundary`
83+
parameter.
84+
85+
.. exception:: StartBoundaryNotFoundDefect
86+
87+
The start boundary claimed in the :mailheader:`Content-Type` header was
88+
never found.
89+
90+
.. exception:: CloseBoundaryNotFoundDefect
91+
92+
A start boundary was found, but no corresponding close boundary was ever
93+
found.
94+
95+
.. versionadded:: 3.3
96+
97+
.. exception:: FirstHeaderLineIsContinuationDefect
98+
99+
The message had a continuation line as its first header line.
100+
101+
.. exception:: MisplacedEnvelopeHeaderDefect
102+
103+
A "Unix From" header was found in the middle of a header block.
104+
105+
.. exception:: MissingHeaderBodySeparatorDefect
106+
107+
A line was found while parsing headers that had no leading white space but
108+
contained no ':'. Parsing continues assuming that the line represents the
109+
first line of the body.
88110

89-
* :class:`StartBoundaryNotFoundDefect` -- The start boundary claimed in the
90-
:mailheader:`Content-Type` header was never found.
111+
.. versionadded:: 3.3
91112

92-
* :class:`CloseBoundaryNotFoundDefect` -- A start boundary was found, but
93-
no corresponding close boundary was ever found.
113+
.. exception:: MalformedHeaderDefect
94114

95-
.. versionadded:: 3.3
115+
A header was found that was missing a colon, or was otherwise malformed.
96116

97-
* :class:`FirstHeaderLineIsContinuationDefect` -- The message had a continuation
98-
line as its first header line.
117+
.. deprecated:: 3.3
118+
This defect has not been used for several Python versions.
99119

100-
* :class:`MisplacedEnvelopeHeaderDefect` - A "Unix From" header was found in the
101-
middle of a header block.
120+
.. exception:: MultipartInvariantViolationDefect
102121

103-
* :class:`MissingHeaderBodySeparatorDefect` - A line was found while parsing
104-
headers that had no leading white space but contained no ':'. Parsing
105-
continues assuming that the line represents the first line of the body.
122+
A message claimed to be a :mimetype:`multipart`, but no subparts were found.
123+
Note that when a message has this defect, its
124+
:meth:`~email.message.Message.is_multipart` method may return ``False``
125+
even though its content type claims to be :mimetype:`multipart`.
106126

107-
.. versionadded:: 3.3
127+
.. exception:: InvalidBase64PaddingDefect
108128

109-
* :class:`MalformedHeaderDefect` -- A header was found that was missing a colon,
110-
or was otherwise malformed.
129+
When decoding a block of base64 encoded bytes, the padding was not correct.
130+
Enough padding is added to perform the decode, but the resulting decoded
131+
bytes may be invalid.
111132

112-
.. deprecated:: 3.3
113-
This defect has not been used for several Python versions.
133+
.. exception:: InvalidBase64CharactersDefect
114134

115-
* :class:`MultipartInvariantViolationDefect` -- A message claimed to be a
116-
:mimetype:`multipart`, but no subparts were found. Note that when a message
117-
has this defect, its :meth:`~email.message.Message.is_multipart` method may
118-
return ``False`` even though its content type claims to be :mimetype:`multipart`.
135+
When decoding a block of base64 encoded bytes, characters outside the base64
136+
alphabet were encountered. The characters are ignored, but the resulting
137+
decoded bytes may be invalid.
119138

120-
* :class:`InvalidBase64PaddingDefect` -- When decoding a block of base64
121-
encoded bytes, the padding was not correct. Enough padding is added to
122-
perform the decode, but the resulting decoded bytes may be invalid.
139+
.. exception:: InvalidBase64LengthDefect
123140

124-
* :class:`InvalidBase64CharactersDefect` -- When decoding a block of base64
125-
encoded bytes, characters outside the base64 alphabet were encountered.
126-
The characters are ignored, but the resulting decoded bytes may be invalid.
141+
When decoding a block of base64 encoded bytes, the number of non-padding
142+
base64 characters was invalid (1 more than a multiple of 4). The encoded
143+
block was kept as-is.
127144

128-
* :class:`InvalidBase64LengthDefect` -- When decoding a block of base64 encoded
129-
bytes, the number of non-padding base64 characters was invalid (1 more than
130-
a multiple of 4). The encoded block was kept as-is.
145+
.. exception:: InvalidDateDefect
131146

132-
* :class:`InvalidDateDefect` -- When decoding an invalid or unparsable date field.
133-
The original value is kept as-is.
147+
When decoding an invalid or unparsable date field. The original value is
148+
kept as-is.

_sources/library/exceptions.rst.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,13 @@ The following exceptions are the exceptions that are usually raised.
333333
meant to be supported at all -- in that case either leave the operator /
334334
method undefined or, if a subclass, set it to :data:`None`.
335335

336-
.. note::
336+
.. caution::
337+
338+
:exc:`!NotImplementedError` and :data:`!NotImplemented` are not
339+
interchangeable. This exception should only be used as described
340+
above; see :data:`NotImplemented` for details on correct usage of
341+
the built-in constant.
337342

338-
``NotImplementedError`` and :data:`NotImplemented` are not interchangeable,
339-
even though they have similar names and purposes. See
340-
:data:`!NotImplemented` for details on when to use it.
341343

342344
.. exception:: OSError([arg])
343345
OSError(errno, strerror[, filename[, winerror[, filename2]]])

0 commit comments

Comments
 (0)