Skip to content

Commit ffca2a0

Browse files
Deploy preview for PR 1211 🛫
1 parent 6921889 commit ffca2a0

File tree

582 files changed

+617
-604
lines changed

Some content is hidden

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

582 files changed

+617
-604
lines changed

pr-preview/pr-1211/_sources/library/contextlib.rst.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Functions and classes provided:
2121
.. class:: AbstractContextManager
2222

2323
An :term:`abstract base class` for classes that implement
24-
:meth:`object.__enter__` and :meth:`object.__exit__`. A default
25-
implementation for :meth:`object.__enter__` is provided which returns
26-
``self`` while :meth:`object.__exit__` is an abstract method which by default
24+
:meth:`~object.__enter__` and :meth:`~object.__exit__`. A default
25+
implementation for :meth:`~object.__enter__` is provided which returns
26+
``self`` while :meth:`~object.__exit__` is an abstract method which by default
2727
returns ``None``. See also the definition of :ref:`typecontextmanager`.
2828

2929
.. versionadded:: 3.6
@@ -32,9 +32,9 @@ Functions and classes provided:
3232
.. class:: AbstractAsyncContextManager
3333

3434
An :term:`abstract base class` for classes that implement
35-
:meth:`object.__aenter__` and :meth:`object.__aexit__`. A default
36-
implementation for :meth:`object.__aenter__` is provided which returns
37-
``self`` while :meth:`object.__aexit__` is an abstract method which by default
35+
:meth:`~object.__aenter__` and :meth:`~object.__aexit__`. A default
36+
implementation for :meth:`~object.__aenter__` is provided which returns
37+
``self`` while :meth:`~object.__aexit__` is an abstract method which by default
3838
returns ``None``. See also the definition of
3939
:ref:`async-context-managers`.
4040

@@ -228,7 +228,7 @@ Functions and classes provided:
228228

229229
.. function:: nullcontext(enter_result=None)
230230

231-
Return a context manager that returns *enter_result* from ``__enter__``, but
231+
Return a context manager that returns *enter_result* from :meth:`~object.__enter__`, but
232232
otherwise does nothing. It is intended to be used as a stand-in for an
233233
optional context manager, for example::
234234

@@ -335,7 +335,7 @@ Functions and classes provided:
335335
For example, the output of :func:`help` normally is sent to *sys.stdout*.
336336
You can capture that output in a string by redirecting the output to an
337337
:class:`io.StringIO` object. The replacement stream is returned from the
338-
``__enter__`` method and so is available as the target of the
338+
:meth:`~object.__enter__` method and so is available as the target of the
339339
:keyword:`with` statement::
340340

341341
with redirect_stdout(io.StringIO()) as f:
@@ -396,7 +396,8 @@ Functions and classes provided:
396396
A base class that enables a context manager to also be used as a decorator.
397397

398398
Context managers inheriting from ``ContextDecorator`` have to implement
399-
``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional
399+
:meth:`~object.__enter__` and :meth:`~object.__exit__` as normal.
400+
``__exit__`` retains its optional
400401
exception handling even when used as a decorator.
401402

402403
``ContextDecorator`` is used by :func:`contextmanager`, so you get this
@@ -697,9 +698,9 @@ context management protocol.
697698
Catching exceptions from ``__enter__`` methods
698699
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
699700

700-
It is occasionally desirable to catch exceptions from an ``__enter__``
701+
It is occasionally desirable to catch exceptions from an :meth:`~object.__enter__`
701702
method implementation, *without* inadvertently catching exceptions from
702-
the :keyword:`with` statement body or the context manager's ``__exit__``
703+
the :keyword:`with` statement body or the context manager's :meth:`~object.__exit__`
703704
method. By using :class:`ExitStack` the steps in the context management
704705
protocol can be separated slightly in order to allow this::
705706

pr-preview/pr-1211/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ <h3>導航</h3>
356356
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
357357
<br>
358358
<br>
359-
最後更新於 3月 01, 2026 (00:26 UTC)。
359+
最後更新於 3月 03, 2026 (00:26 UTC)。
360360

361361
<a href="/bugs.html">發現 bug</a>
362362

pr-preview/pr-1211/bugs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ <h3>導航</h3>
393393
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
394394
<br>
395395
<br>
396-
最後更新於 3月 01, 2026 (00:26 UTC)。
396+
最後更新於 3月 03, 2026 (00:26 UTC)。
397397

398398
<a href="/bugs.html">發現 bug</a>
399399

pr-preview/pr-1211/c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ <h3>導航</h3>
365365
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
366366
<br>
367367
<br>
368-
最後更新於 3月 01, 2026 (00:26 UTC)。
368+
最後更新於 3月 03, 2026 (00:26 UTC)。
369369

370370
<a href="/bugs.html">發現 bug</a>
371371

pr-preview/pr-1211/c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ <h3>導航</h3>
574574
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
575575
<br>
576576
<br>
577-
最後更新於 3月 01, 2026 (00:26 UTC)。
577+
最後更新於 3月 03, 2026 (00:26 UTC)。
578578

579579
<a href="/bugs.html">發現 bug</a>
580580

pr-preview/pr-1211/c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ <h3>導航</h3>
514514
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
515515
<br>
516516
<br>
517-
最後更新於 3月 01, 2026 (00:26 UTC)。
517+
最後更新於 3月 03, 2026 (00:26 UTC)。
518518

519519
<a href="/bugs.html">發現 bug</a>
520520

pr-preview/pr-1211/c-api/arg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ <h3>導航</h3>
996996
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
997997
<br>
998998
<br>
999-
最後更新於 3月 01, 2026 (00:26 UTC)。
999+
最後更新於 3月 03, 2026 (00:26 UTC)。
10001000

10011001
<a href="/bugs.html">發現 bug</a>
10021002

pr-preview/pr-1211/c-api/bool.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h3>導航</h3>
376376
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
377377
<br>
378378
<br>
379-
最後更新於 3月 01, 2026 (00:26 UTC)。
379+
最後更新於 3月 03, 2026 (00:26 UTC)。
380380

381381
<a href="/bugs.html">發現 bug</a>
382382

pr-preview/pr-1211/c-api/buffer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ <h3>導航</h3>
10641064
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
10651065
<br>
10661066
<br>
1067-
最後更新於 3月 01, 2026 (00:26 UTC)。
1067+
最後更新於 3月 03, 2026 (00:26 UTC)。
10681068

10691069
<a href="/bugs.html">發現 bug</a>
10701070

pr-preview/pr-1211/c-api/bytearray.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ <h3>導航</h3>
439439
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
440440
<br>
441441
<br>
442-
最後更新於 3月 01, 2026 (00:26 UTC)。
442+
最後更新於 3月 03, 2026 (00:26 UTC)。
443443

444444
<a href="/bugs.html">發現 bug</a>
445445

0 commit comments

Comments
 (0)