Skip to content

Commit 0739340

Browse files
committed
Deploying to gh-pages from @ c5c4108 🚀
1 parent e341412 commit 0739340

File tree

534 files changed

+4755
-4321
lines changed

Some content is hidden

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

534 files changed

+4755
-4321
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: 2fe8bf9a70f81417777be95158e85b7e
3+
config: 70acfcb150d1d3d6322c07c841f24a08
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_sources/library/http.cookies.rst.txt

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ cookie value.
1818

1919
The module formerly strictly applied the parsing rules described in the
2020
:rfc:`2109` and :rfc:`2068` specifications. It has since been discovered that
21-
MSIE 3.0x doesn't follow the character rules outlined in those specs and also
22-
many current day browsers and servers have relaxed parsing rules when comes to
23-
Cookie handling. As a result, the parsing rules used are a bit less strict.
21+
MSIE 3.0x didn't follow the character rules outlined in those specs; many
22+
current-day browsers and servers have also relaxed parsing rules when it comes
23+
to cookie handling. As a result, this module now uses parsing rules that are a
24+
bit less strict than they once were.
2425

2526
The character set, :data:`string.ascii_letters`, :data:`string.digits` and
2627
``!#$%&'*+-.^_`|~:`` denote the set of valid characters allowed by this module
27-
in Cookie name (as :attr:`~Morsel.key`).
28+
in a cookie name (as :attr:`~Morsel.key`).
2829

2930
.. versionchanged:: 3.3
30-
Allowed ':' as a valid Cookie name character.
31+
Allowed ':' as a valid cookie name character.
3132

3233

3334
.. note::
@@ -54,9 +55,10 @@ in Cookie name (as :attr:`~Morsel.key`).
5455

5556
.. class:: SimpleCookie([input])
5657

57-
This class derives from :class:`BaseCookie` and overrides :meth:`value_decode`
58-
and :meth:`value_encode`. SimpleCookie supports strings as cookie values.
59-
When setting the value, SimpleCookie calls the builtin :func:`str()` to convert
58+
This class derives from :class:`BaseCookie` and overrides :meth:`~BaseCookie.value_decode`
59+
and :meth:`~BaseCookie.value_encode`. :class:`!SimpleCookie` supports
60+
strings as cookie values. When setting the value, :class:`!SimpleCookie`
61+
calls the builtin :func:`str` to convert
6062
the value to a string. Values received from HTTP are kept as strings.
6163

6264
.. seealso::
@@ -129,17 +131,17 @@ Morsel Objects
129131
Abstract a key/value pair, which has some :rfc:`2109` attributes.
130132

131133
Morsels are dictionary-like objects, whose set of keys is constant --- the valid
132-
:rfc:`2109` attributes, which are
133-
134-
* ``expires``
135-
* ``path``
136-
* ``comment``
137-
* ``domain``
138-
* ``max-age``
139-
* ``secure``
140-
* ``version``
141-
* ``httponly``
142-
* ``samesite``
134+
:rfc:`2109` attributes, which are:
135+
136+
.. attribute:: expires
137+
path
138+
comment
139+
domain
140+
max-age
141+
secure
142+
version
143+
httponly
144+
samesite
143145

144146
The attribute :attr:`httponly` specifies that the cookie is only transferred
145147
in HTTP requests, and is not accessible through JavaScript. This is intended
@@ -152,7 +154,7 @@ Morsel Objects
152154
The keys are case-insensitive and their default value is ``''``.
153155

154156
.. versionchanged:: 3.5
155-
:meth:`~Morsel.__eq__` now takes :attr:`~Morsel.key` and :attr:`~Morsel.value`
157+
:meth:`!__eq__` now takes :attr:`~Morsel.key` and :attr:`~Morsel.value`
156158
into account.
157159

158160
.. versionchanged:: 3.7

_sources/library/stdtypes.rst.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5458,8 +5458,9 @@ It is written as ``NotImplemented``.
54585458
Internal Objects
54595459
----------------
54605460

5461-
See :ref:`types` for this information. It describes stack frame objects,
5462-
traceback objects, and slice objects.
5461+
See :ref:`types` for this information. It describes
5462+
:ref:`stack frame objects <frame-objects>`,
5463+
:ref:`traceback objects <traceback-objects>`, and slice objects.
54635464

54645465

54655466
.. _specialattrs:

_sources/library/tempfile.rst.txt

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This module creates temporary files and directories. It works on all
1818
supported platforms. :class:`TemporaryFile`, :class:`NamedTemporaryFile`,
1919
:class:`TemporaryDirectory`, and :class:`SpooledTemporaryFile` are high-level
2020
interfaces which provide automatic cleanup and can be used as
21-
context managers. :func:`mkstemp` and
21+
:term:`context managers <context manager>`. :func:`mkstemp` and
2222
:func:`mkdtemp` are lower-level functions which require manual cleanup.
2323

2424
All the user-callable functions and constructors take additional arguments which
@@ -41,7 +41,7 @@ The module defines the following user-callable items:
4141
this; your code should not rely on a temporary file created using this
4242
function having or not having a visible name in the file system.
4343

44-
The resulting object can be used as a context manager (see
44+
The resulting object can be used as a :term:`context manager` (see
4545
:ref:`tempfile-examples`). On completion of the context or
4646
destruction of the file object the temporary file will be removed
4747
from the filesystem.
@@ -87,9 +87,9 @@ The module defines the following user-callable items:
8787
determine whether and how the named file should be automatically deleted.
8888

8989
The returned object is always a :term:`file-like object` whose :attr:`!file`
90-
attribute is the underlying true file object. This :term:`file-like object`
90+
attribute is the underlying true file object. This file-like object
9191
can be used in a :keyword:`with` statement, just like a normal file. The
92-
name of the temporary file can be retrieved from the :attr:`name` attribute
92+
name of the temporary file can be retrieved from the :attr:`!name` attribute
9393
of the returned file-like object. On Unix, unlike with the
9494
:func:`TemporaryFile`, the directory entry does not get unlinked immediately
9595
after the file creation.
@@ -151,18 +151,20 @@ The module defines the following user-callable items:
151151
contents are written to disk and operation proceeds as with
152152
:func:`TemporaryFile`.
153153

154-
The resulting file has one additional method, :func:`rollover`, which
155-
causes the file to roll over to an on-disk file regardless of its size.
154+
.. method:: SpooledTemporaryFile.rollover
156155

157-
The returned object is a file-like object whose :attr:`_file` attribute
156+
The resulting file has one additional method, :meth:`!rollover`, which
157+
causes the file to roll over to an on-disk file regardless of its size.
158+
159+
The returned object is a file-like object whose :attr:`!_file` attribute
158160
is either an :class:`io.BytesIO` or :class:`io.TextIOWrapper` object
159161
(depending on whether binary or text *mode* was specified) or a true file
160-
object, depending on whether :func:`rollover` has been called. This
162+
object, depending on whether :meth:`rollover` has been called. This
161163
file-like object can be used in a :keyword:`with` statement, just like
162164
a normal file.
163165

164166
.. versionchanged:: 3.3
165-
the truncate method now accepts a ``size`` argument.
167+
the truncate method now accepts a *size* argument.
166168

167169
.. versionchanged:: 3.8
168170
Added *errors* parameter.
@@ -176,24 +178,28 @@ The module defines the following user-callable items:
176178
.. class:: TemporaryDirectory(suffix=None, prefix=None, dir=None, ignore_cleanup_errors=False, *, delete=True)
177179

178180
This class securely creates a temporary directory using the same rules as :func:`mkdtemp`.
179-
The resulting object can be used as a context manager (see
181+
The resulting object can be used as a :term:`context manager` (see
180182
:ref:`tempfile-examples`). On completion of the context or destruction
181183
of the temporary directory object, the newly created temporary directory
182184
and all its contents are removed from the filesystem.
183185

184-
The directory name can be retrieved from the :attr:`name` attribute of the
185-
returned object. When the returned object is used as a context manager, the
186-
:attr:`name` will be assigned to the target of the :keyword:`!as` clause in
187-
the :keyword:`with` statement, if there is one.
188-
189-
The directory can be explicitly cleaned up by calling the
190-
:func:`cleanup` method. If *ignore_cleanup_errors* is true, any unhandled
191-
exceptions during explicit or implicit cleanup (such as a
192-
:exc:`PermissionError` removing open files on Windows) will be ignored,
193-
and the remaining removable items deleted on a "best-effort" basis.
194-
Otherwise, errors will be raised in whatever context cleanup occurs
195-
(the :func:`cleanup` call, exiting the context manager, when the object
196-
is garbage-collected or during interpreter shutdown).
186+
.. attribute:: TemporaryDirectory.name
187+
188+
The directory name can be retrieved from the :attr:`!name` attribute of the
189+
returned object. When the returned object is used as a :term:`context manager`, the
190+
:attr:`!name` will be assigned to the target of the :keyword:`!as` clause in
191+
the :keyword:`with` statement, if there is one.
192+
193+
.. method:: TemporaryDirectory.cleanup
194+
195+
The directory can be explicitly cleaned up by calling the
196+
:meth:`!cleanup` method. If *ignore_cleanup_errors* is true, any unhandled
197+
exceptions during explicit or implicit cleanup (such as a
198+
:exc:`PermissionError` removing open files on Windows) will be ignored,
199+
and the remaining removable items deleted on a "best-effort" basis.
200+
Otherwise, errors will be raised in whatever context cleanup occurs
201+
(the :meth:`!cleanup` call, exiting the context manager, when the object
202+
is garbage-collected or during interpreter shutdown).
197203

198204
The *delete* parameter can be used to disable cleanup of the directory tree
199205
upon exiting the context. While it may seem unusual for a context manager

_sources/library/traceback.rst.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ interpreter.
1616

1717
.. index:: pair: object; traceback
1818

19-
The module uses traceback objects --- these are objects of type :class:`types.TracebackType`,
19+
The module uses :ref:`traceback objects <traceback-objects>` --- these are
20+
objects of type :class:`types.TracebackType`,
2021
which are assigned to the ``__traceback__`` field of :class:`BaseException` instances.
2122

2223
.. seealso::
@@ -205,7 +206,8 @@ The module defines the following functions:
205206

206207
.. function:: walk_tb(tb)
207208

208-
Walk a traceback following ``tb_next`` yielding the frame and line number
209+
Walk a traceback following :attr:`~traceback.tb_next` yielding the frame and
210+
line number
209211
for each frame. This helper is used with :meth:`StackSummary.extract`.
210212

211213
.. versionadded:: 3.5

_sources/library/types.rst.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,8 @@ Standard names are defined for the following types:
376376

377377
.. data:: FrameType
378378

379-
The type of frame objects such as found in ``tb.tb_frame`` if ``tb`` is a
380-
traceback object.
381-
382-
See :ref:`the language reference <frame-objects>` for details of the
383-
available attributes and operations.
379+
The type of :ref:`frame objects <frame-objects>` such as found in
380+
:attr:`tb.tb_frame <traceback.tb_frame>` if ``tb`` is a traceback object.
384381

385382

386383
.. data:: GetSetDescriptorType

_sources/reference/datamodel.rst.txt

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,8 +1244,9 @@ Frame objects
12441244

12451245
.. index:: pair: object; frame
12461246

1247-
Frame objects represent execution frames. They may occur in traceback objects
1248-
(see below), and are also passed to registered trace functions.
1247+
Frame objects represent execution frames. They may occur in
1248+
:ref:`traceback objects <traceback-objects>`,
1249+
and are also passed to registered trace functions.
12491250

12501251
.. index::
12511252
single: f_back (frame attribute)
@@ -1352,26 +1353,30 @@ Traceback objects
13521353
single: sys.exception
13531354
single: sys.last_traceback
13541355

1355-
Traceback objects represent a stack trace of an exception. A traceback object
1356+
Traceback objects represent the stack trace of an :ref:`exception <tut-errors>`.
1357+
A traceback object
13561358
is implicitly created when an exception occurs, and may also be explicitly
13571359
created by calling :class:`types.TracebackType`.
13581360

1361+
.. versionchanged:: 3.7
1362+
Traceback objects can now be explicitly instantiated from Python code.
1363+
13591364
For implicitly created tracebacks, when the search for an exception handler
13601365
unwinds the execution stack, at each unwound level a traceback object is
13611366
inserted in front of the current traceback. When an exception handler is
13621367
entered, the stack trace is made available to the program. (See section
13631368
:ref:`try`.) It is accessible as the third item of the
1364-
tuple returned by ``sys.exc_info()``, and as the ``__traceback__`` attribute
1369+
tuple returned by :func:`sys.exc_info`, and as the ``__traceback__`` attribute
13651370
of the caught exception.
13661371

13671372
When the program contains no suitable
13681373
handler, the stack trace is written (nicely formatted) to the standard error
13691374
stream; if the interpreter is interactive, it is also made available to the user
1370-
as ``sys.last_traceback``.
1375+
as :data:`sys.last_traceback`.
13711376

13721377
For explicitly created tracebacks, it is up to the creator of the traceback
1373-
to determine how the ``tb_next`` attributes should be linked to form a
1374-
full stack trace.
1378+
to determine how the :attr:`~traceback.tb_next` attributes should be linked to
1379+
form a full stack trace.
13751380

13761381
.. index::
13771382
single: tb_frame (traceback attribute)
@@ -1380,27 +1385,40 @@ full stack trace.
13801385
pair: statement; try
13811386

13821387
Special read-only attributes:
1383-
:attr:`tb_frame` points to the execution frame of the current level;
1384-
:attr:`tb_lineno` gives the line number where the exception occurred;
1385-
:attr:`tb_lasti` indicates the precise instruction.
1388+
1389+
.. list-table::
1390+
1391+
* - .. attribute:: traceback.tb_frame
1392+
- Points to the execution :ref:`frame <frame-objects>` of the current
1393+
level.
1394+
1395+
Accessing this attribute raises an
1396+
:ref:`auditing event <auditing>` ``object.__getattr__`` with arguments
1397+
``obj`` and ``"tb_frame"``.
1398+
1399+
* - .. attribute:: traceback.tb_lineno
1400+
- Gives the line number where the exception occurred
1401+
1402+
* - .. attribute:: traceback.tb_lasti
1403+
- Indicates the "precise instruction".
1404+
13861405
The line number and last instruction in the traceback may differ from the
1387-
line number of its frame object if the exception occurred in a
1406+
line number of its :ref:`frame object <frame-objects>` if the exception
1407+
occurred in a
13881408
:keyword:`try` statement with no matching except clause or with a
1389-
finally clause.
1390-
1391-
Accessing ``tb_frame`` raises an :ref:`auditing event <auditing>`
1392-
``object.__getattr__`` with arguments ``obj`` and ``"tb_frame"``.
1409+
:keyword:`finally` clause.
13931410

13941411
.. index::
13951412
single: tb_next (traceback attribute)
13961413

1397-
Special writable attribute: :attr:`tb_next` is the next level in the stack
1398-
trace (towards the frame where the exception occurred), or ``None`` if
1399-
there is no next level.
1414+
.. attribute:: traceback.tb_next
14001415

1401-
.. versionchanged:: 3.7
1402-
Traceback objects can now be explicitly instantiated from Python code,
1403-
and the ``tb_next`` attribute of existing instances can be updated.
1416+
The special writable attribute :attr:`!tb_next` is the next level in the
1417+
stack trace (towards the frame where the exception occurred), or ``None`` if
1418+
there is no next level.
1419+
1420+
.. versionchanged:: 3.7
1421+
This attribute is now writable
14041422

14051423

14061424
Slice objects

_sources/reference/lexical_analysis.rst.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,10 +708,12 @@ and formatted string literals may be concatenated with plain string literals.
708708
single: ! (exclamation); in formatted string literal
709709
single: : (colon); in formatted string literal
710710
single: = (equals); for help in debugging using string literals
711+
711712
.. _f-strings:
713+
.. _formatted-string-literals:
712714

713-
Formatted string literals
714-
-------------------------
715+
f-strings
716+
---------
715717

716718
.. versionadded:: 3.6
717719

_sources/whatsnew/3.5.rst.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1947,7 +1947,8 @@ traceback
19471947
---------
19481948

19491949
New :func:`~traceback.walk_stack` and :func:`~traceback.walk_tb`
1950-
functions to conveniently traverse frame and traceback objects.
1950+
functions to conveniently traverse frame and
1951+
:ref:`traceback objects <traceback-objects>`.
19511952
(Contributed by Robert Collins in :issue:`17911`.)
19521953

19531954
New lightweight classes: :class:`~traceback.TracebackException`,

_sources/whatsnew/3.7.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,8 @@ Other Language Changes
525525

526526
* In order to better support dynamic creation of stack traces,
527527
:class:`types.TracebackType` can now be instantiated from Python code, and
528-
the ``tb_next`` attribute on :ref:`tracebacks <traceback-objects>` is now
529-
writable.
528+
the :attr:`~traceback.tb_next` attribute on
529+
:ref:`tracebacks <traceback-objects>` is now writable.
530530
(Contributed by Nathaniel J. Smith in :issue:`30579`.)
531531

532532
* When using the :option:`-m` switch, ``sys.path[0]`` is now eagerly expanded

0 commit comments

Comments
 (0)