8000 Tag strings v2 by gvanrossum · Pull Request #103835 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Tag strings v2 #103835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1,213 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
1213 commits
Select commit Hold shift + click to select a range
96e42d2
[3.12] Update floatingpoint.rst (GH-110509) (#110513)
miss-islington Oct 8, 2023
ef4bd1b
[3.12] gh-110237: Check `PyList_Append` for errors in `_PyEval_MatchC…
miss-islington Oct 8, 2023
fb8c041
[3.12] gh-110534 fix a URL redirect to wikipedia article on Fibonacci…
miss-islington Oct 9, 2023
dae3db1
[3.12] gh-110514: Add PY_THROW to `sys.setprofile` events (GH-110524)…
miss-islington Oct 9, 2023
d152823
[3.12] gh-109286: Update Windows installer to use SQLite 3.43.1 (GH-1…
miss-islington Oct 9, 2023
22474a1
[3.12] gh-109151: Revert readline support in the sqlite3 CLI (#110542)
serhiy-storchaka Oct 9, 2023
a7fe709
[3.12] gh-110497: Add note about `OSError` being an alias to `IOError…
miss-islington Oct 9, 2023
3ed5cb0
[3.12] gh-110525: Add CAPI tests for set and frozenset objects (GH-11…
sobolevn Oct 9, 2023
2362446
[3.12] gh-109286: Update macOS installer to use SQLite 3.43.1 (GH-110…
miss-islington Oct 9, 2023
b2419ef
[3.12] gh-110525: Cover PySet_Add corner case with frozenset objects …
miss-islington Oct 9, 2023
13ad121
[3.12] gh-110437: Allow overriding VCRuntimeDLL with a semicolon sepa…
miss-islington Oct 9, 2023
5afac0c
[3.12] gh-110549: Remove unused includes of <stddef.h> in _testcapi (…
serhiy-storchaka Oct 9, 2023
53122bc
[3.12] gh-109191: Fix build with newer editline (gh-110239) (gh-110562)
miss-islington Oct 9, 2023
1f43bc2
[3.12] gh-110519: Improve deprecation warning in the gettext module (…
miss-islington Oct 9, 2023
c8bffd1
[3.12] Remove unused `SPHINXLINT` var from `Doc/Makefile`. (GH-110570…
miss-islington Oct 10, 2023
e73210c
[3.12] Add some 'meta hooks' to our pre-commit config (GH-110587) (#1…
miss-islington Oct 10, 2023
0ffbde4
[3.12] gh-109408: Add the docs whitespace check from patchcheck to pr…
miss-islington Oct 10, 2023
3688672
[3.12] gh-110558: Run ruff on Argument Clinic in CI (#110559) (#110598)
AlexWaygood Oct 10, 2023
2fc8081
[3.12] gh-110378: Close invalid generators in contextmanager and asyn…
miss-islington Oct 10, 2023
190660a
[3.12] gh-78469: Declare missing sethostname for Solaris 10 (GH-10944…
miss-islington Oct 10, 2023
55d6076
[3.12] gh-110558: Enable ruff's pyupgrade rules when running on Argum…
miss-islington Oct 10, 2023
c1e8e90
[3.12] gh-110590: Fix a bug where _sre.compile would overwrite except…
miss-islington Oct 10, 2023
26a3563
[3.12] gh-110378: Fix test_async_gen_propagates_generator_exit in tes…
miss-islington Oct 10, 2023
80e4abe
[3.12] gh-101100: Fix sphinx warnings in `library/socketserver.rst` (…
miss-islington Oct 10, 2023
555db6f
[3.12] gh-81002: Add tests for termios (GH-110386) (GH-110619)
miss-islington Oct 10, 2023
43641f5
[3.12] gh-110388: Add tests for tty (GH-110394) (#110621)
miss-islington Oct 10, 2023
33450a9
[3.12] Don't doubly-parallelise sphinx-lint (GH-110617) (#110626)
miss-islington Oct 10, 2023
9485765
[3.12] GH-109408: Move the Python file whitespace check from patchche…
miss-islington Oct 10, 2023
c9157fe
[3.12] GH-109408: Move the C file whitespace check from patchcheck to…
AA-Turner Oct 10, 2023
5b168fd
[3.12] gh-110631: Set three-space indents for reST in EditorConfig (G…
miss-islington Oct 10, 2023
c2d542b
[3.12] gh-108303: Move all certificates to `Lib/test/certdata/` (GH-1…
miss-islington Oct 10, 2023
dcd47e5
[3.12] gh-110647: Fix signal test_stress_modifying_handlers() (GH-110…
miss-islington Oct 11, 2023
55448a5
[3.12] gh-110656: Fix logging test_post_fork_child_no_deadlock() if A…
miss-islington Oct 11, 2023
18458a5
[3.12] gh-110666: Fix multiprocessing test_terminate() elapsed (GH-11…
miss-islington Oct 11, 2023
be381b5
[3.12] gh-110662: multiprocessing test_async_timeout() increase timeo…
miss-islington Oct 11, 2023
9ffef4d
[3.12] GH-110488: Fix two small issues in `pathlib.PurePath.with_name…
barneygale Oct 11, 2023
ca971d1
[3.12] gh-84489: C API: Add tests for Py_BuildValue() (GH-110596) (GH…
miss-islington Oct 11, 2023
1ea4cb1
[3.12] gh-110631: fix wrong indentation in the `Doc/whatsnew` dir (GH…
ezio-melotti Oct 11, 2023
bfb1f00
[3.12] gh-76106: Remove the cleanup lock in test_socket (GH-110539) …
miss-islington Oct 11, 2023
c06ac1b
[3.12] gh-109408: Revert pre-commit whitespace checks pending portabl…
miss-islington Oct 11, 2023
989aa44
[3.12] gh-65052: Prevent pdb from crashing when trying to display obj…
miss-islington Oct 11, 2023
e6c53dd
[3.12] gh-108826: Document `dis` module CLI and rename `_test` functi…
hugovk Oct 11, 2023
cae968b
[3.12] gh-110631: Fix reST indentation in `Doc/library` (GH-110685) (…
miss-islington Oct 11, 2023
7d5a982
[3.12] gh-110631: Fix reST indentation (GH-110724) (#110738)
ezio-melotti Oct 11, 2023
dbbe0ee
[3.12] gh-110631: Fix reST indentation in `Doc/reference` (GH-110708)…
miss-islington Oct 11, 2023
ea344e7
[3.12] gh-110673: test_pty raises on short write (GH-110677) (#110742)
miss-islington Oct 12, 2023
e8d0419
[3.12] GH-107518: Remove the Argument Clinic How-To (#109900) (#110760)
erlend-aasland Oct 12, 2023
ea3ac56
[3.12] gh-107450: Raise OverflowError when parser column offset overf…
miss-islington Oct 12, 2023
4d0e6c8
[3.12] gh-110696: Fix incorrect syntax error message for incorrect ar…
pablogsal Oct 12, 2023
4b7a12d
[3.12] gh-110756: Sync regrtest with main branch (#110758)
vstinner Oct 12, 2023
80f9585
[3.12] gh-110756: Sync regrtest with main branch (#110779)
vstinner Oct 12, 2023
27d5ea2
[3.12] gh-110782: Fix crash when TypeVar is constructed with keyword …
miss-islington Oct 12, 2023
08242cd
[3.12] gh-107450: Fix parser column offset overflow test on Windows (…
miss-islington Oct 13, 2023
f2e353b
[3.12] gh-110803: Reorganize docs for what PyType_Slot doesn't cover …
miss-islington Oct 13, 2023
1a7afa7
[3.12] gh-110703: Add asyncio.wait_for() change notes for 3.11 (GH-11…
miss-islington Oct 13, 2023
1c44f88
[3.12] gh-110815: Improve tests for PyArg_ParseTupleAndKeywords() (GH…
miss-islington Oct 13, 2023
49da117
[3.12] Bump sphinx-lint to 0.7.0 (GH-110830) (#110833)
miss-islington Oct 13, 2023
0102faf
[3.12] gh-108303: Move all inspect test files to `test_inspect/` (GH-…
sobolevn Oct 13, 2023
0164832
[3.12] gh-110392: Fix tty functions (GH-110642) (GH-110853)
miss-islington Oct 14, 2023
12b9cb8
[3.12] gh-101100: Fix sphinx warnings in `usage/cmdline.rst` (GH-1108…
miss-islington Oct 14, 2023
a2cc9a4
[3.12] gh-109747: Improve errors for unsupported look-behind patterns…
miss-islington Oct 14, 2023
9a62322
[3.12] gh-107705: Fix file leak in test_tkinter in the C locale (GH-1…
miss-islington Oct 14, 2023
7c3e8e5
[3.12] gh-110628: Add tests for PyLong C API (GH-110629) (GH-110854)
serhiy-storchaka Oct 14, 2023
9786959
[3.12] gh-110715: Add missing import in zipfile (gh-110822) (gh-110861)
miss-islington Oct 14, 2023
0c56c05
[3.12] remove redundant call to attach_loop in watcher (GH-110847) (#…
miss-islington Oct 14, 2023
744f752
[3.12] gh-101100: Fix sphinx warnings in `library/time.rst` (GH-11086…
miss-islington Oct 14, 2023
b6755d8
[3.12] gh-109216: Fix possible memory leak in `BUILD_MAP` (#109324)
sobolevn Oct 15, 2023
72b0f0e
[3.12] bpo-42663: Fix parsing TZ strings in zoneinfo module (GH-23825…
serhiy-storchaka Oct 15, 2023
97f4b66
[3.12] gh-110886 Doc: add a link to BNF Wikipedia article (GH-110887)…
miss-islington Oct 15, 2023
9c39149
[3.12] gh-106193: Rename and fix duplicated tests in `test_monitoring…
hugovk Oct 15, 2023
7de3c8b
[3.12] Lint: Include test_monitoring.py for Ruff (GH-110898) (#110899)
miss-islington Oct 15, 2023
b4ed730
[3.12] gh-110527: Improve `PySet_Clear` docs (GH-110528) (#110928)
miss-islington Oct 16, 2023
89f9c22
[3.12] regrtest: Prepend 'use' options in --{fast,slow}-ci (GH-110363…
miss-islington Oct 16, 2023
b8e5b1b
[3.12] Enable ruff on several more files in `Lib/test` (#110929) (#11…
AlexWaygood Oct 16, 2023
3b87e52
[3.12] gh-107450: Check for overflow in the tokenizer and fix overflo…
lysnikolaou Oct 16, 2023
94525a7
[3.12] C-API docs: Clarify the size of arenas (GH-110895) (#110946)
miss-islington Oct 16, 2023
99b7e1c
[3.12] Bump sphinx-lint to v0.8.1 (GH-110933) (#110957)
miss-islington Oct 17, 2023
9aa8993
[3.12] gh-110695: test_asyncio uses 50 ms for clock resolution (GH-11…
miss-islington Oct 17, 2023
c1e5343
[3.12] Bump test deps: `ruff` and `pre-commit-hooks` (GH-110972) (#11…
sobolevn Oct 17, 2023
f0c2390
[3.12] gh-110995: Fix test_gdb check_usable_gdb() (GH-110998) (#111003)
miss-islington Oct 17, 2023
ae838af
[3.12] gh-107457: update dis documentation with changes in 3.12 (GH-1…
miss-islington Oct 17, 2023
8134811
[3.12] Regen Doc/requirements-oldest-sphinx.txt (GH-111012) (#111022)
miss-islington Oct 18, 2023
2bca5f4
[3.12] gh-110938: Fix error messages for indented blocks with functio…
JelleZijlstra Oct 18, 2023
004618f
[3.12] gh-110938: More syntax tests for PEP695 funcs and classes (GH-…
miss-islington Oct 18, 2023
577a8fb
[3.12] gh-111019: Align expected and actual titles in test output (GH…
miss-islington Oct 18, 2023
b8ce5d9
[3.12] gh-103737: IDLE - Remove unneeded .keys() for dict iteration (…
miss-islington Oct 18, 2023
228b124
[3.12] gh-111015: Install IDLE.app and Python Launcher.app on macOS w…
miss-islington Oct 18, 2023
9ef8caf
[3.12] GH-104232: Fix statement about trace return values (GH-111047)
miss-islington Oct 18, 2023
d312135
[3.12] GH-103082: Clean up the sys.monitoring docs (GH-111048)
brandtbucher Oct 18, 2023
e37d56e
[3.12] gh-111050: IDLE - Simplify configdialog.HighPage.theme_element…
miss-islington Oct 19, 2023
40db34c
[3.12] gh-111031: Check more files in `test_tokenize` (GH-111032) (#1…
miss-islington Oct 19, 2023
68a5640
[3.12] gh-108791: Fix pdb CLI invalid argument handling (GH-108816) (…
chgnrdv Oct 19, 2023
cdcab40
[3.12] GH-101100: Fix reference warnings for ``__getitem__`` (GH-1101…
miss-islington Oct 19, 2023
91a6e98
[3.12] GH-101100: Fix reference warnings for ``__enter__`` and ``__ex…
miss-islington Oct 19, 2023
3e9d84c
[3.12] gh-109510: Clearly explain "Which Docstrings Are Examined" (GH…
miss-islington Oct 19, 2023
< 8000 div class="select-menu-item-text"> 41dfae8
[3.12] gh-101100: Fix sphinx warnings in `library/getpass.rst` (GH-11…
hugovk Oct 19, 2023
42fd44a
[3.12] gh-111092: Make turtledemo run without default root enabled (G…
miss-islington Oct 20, 2023
9092251
[3.12] gh-101100: Fix Sphinx warnings in `library/tty.rst` (GH-111079…
miss-islington Oct 20, 2023
b4c215e
[3.12] gh-101100: Fix sphinx warnings in `library/codecs.rst` (GH-110…
miss-islington Oct 20, 2023
6b38ddb
[3.12] Add tests for failing PyUnicode_AsUTF8AndSize() with psize=NUL…
miss-islington Oct 20, 2023
dfc8d7a
gh-110913: Fix WindowsConsoleIO chunking of UTF-8 text (GH-111007)
miss-islington Oct 20, 2023
4a10260
[3.12] gh-111126: Use `isinstance` instead of `assert[Not]IsInstance`…
miss-islington Oct 20, 2023
727f8ee
[3.12] gh-111046: for wasi-threads, export memory as well via the lin…
miss-islington Oct 20, 2023
0409057
[3.12] gh-110932: Fix regrtest for SOURCE_DATE_EPOCH (GH-111143) (#11…
miss-islington Oct 21, 2023
552ceb2
[3.12] gh-110572: Fix potential leaks in test_*_code in _testcapi/get…
miss-islington Oct 21, 2023
6a5ff93
[3.12] gh-111157: Mention `__notes__` in `traceback.format_exception_…
miss-islington Oct 21, 2023
1ea9302
[3.12] gh-110918: regrtest: allow to intermix --match and --ignore op…
serhiy-storchaka Oct 21, 2023
f6cde99
[3.12] gh-111159: Fix `doctest` output comparison for exceptions with…
miss-islington Oct 21, 2023
322f79f
[3.12] Synchronize test_contextlib with test_contextlib_async (GH-111…
miss-islington Oct 21, 2023
028f477
[3.12] gh-111085: Fix invalid state handling in TaskGroup and Timeout…
miss-islington Oct 21, 2023
f2f89bf
[3.12] gh-101100: Fix Sphinx warning in `tutorial/introduction.rst` (…
miss-islington Oct 22, 2023
06fe868
[3.12] gh-101100: Fix sphinx warnings in `library/asyncio-dev.rst` (G…
miss-islington Oct 22, 2023
9e73c71
[3.12] gh-110196: Fix ipaddress.IPv6Address.__reduce__ (GH-110198) (G…
miss-islington Oct 22, 2023
8f94d0f
[3.12] gh-110383: Added explanation about simplest regex use case for…
miss-islington Oct 23, 2023
4d781bc
[3.12] gh-110383: Italicize variable name (GH-111206) (#111207)
miss-islington Oct 23, 2023
d4d947d
[3.12] gh-67565: Add tests for C-contiguity checks (GH-110951) (GH-11…
furkanonder Oct 23, 2023
6a5aab0
[3.12] gh-106310 - document the __signature__ attribute (GH-106311) (…
miss-islington Oct 23, 2023
82c045f
[3.12] typo: missing line of output in pull parser example (GH-111068…
miss-islington Oct 23, 2023
87123ab
[3.12] Add a version added note for PY_VECTORCALL_ARGUMENTS_OFFSET (G…
miss-islington Oct 23, 2023
38578dd
[3.12] gh-101100: Fix Sphinx warnings for `fileno` (GH-111118) (#111226)
miss-islington Oct 23, 2023
b622c2d
[3.12] Fix a code snippet typo in asyncio docs (GH-108427) (#111245)
miss-islington Oct 24, 2023
0bbdfe6
[3.12] GH-94438: Restore ability to jump over None tests (GH-111243)
miss-islington Oct 24, 2023
03c14b0
[3.12] Fix typo in sys docs (GH-111196) (#111248)
miss-islington Oct 24, 2023
df53191
[3.12] gh-75666: Tkinter: add tests for binding (GH-111202) (GH-111255)
miss-islington Oct 24, 2023
edff7c1
[3.12] gh-111151: Convert monospaced directives to :ref: (GH-111152) …
miss-islington Oct 24, 2023
b180120
[3.12] Revert "Fix a code snippet typo in asyncio docs (GH-108427)" (…
miss-islington Oct 24, 2023
b6e508c
[3.12] gh-109017: Use non alternate name for Kyiv (GH-109251) (GH-111…
miss-islington Oct 24, 2023
2a28aa1
[3.12] GH-111182: Update EnumType.__contains__ docs (GH-111184) (GH-1…
miss-islington Oct 24, 2023
a4eb2e3
[3.12] Fix first parameter name in `tool` functions from `sys.monitor…
miss-islington Oct 24, 2023
6f130f2
[3.12] gh-102956: Fix returning of empty byte strings after seek in z…
miss-islington Oct 25, 2023
54e93d3
[3.12] gh-111065: Add more tests for the C API with the PySys_ prefix…
serhiy-storchaka Oct 25, 2023
5e94556
[3.12] Bump test deps: `ruff` and `mypy` (GH-111288) (#111313)
art3xa Oct 25, 2023
45c0b38
[3.12] gh-111174: Fix crash in getbuffer() called repeatedly for empt…
miss-islington Oct 25, 2023
5c4f9a1
[3.12] gh-111165: Move test running code from test.support to libregr…
serhiy-storchaka Oct 25, 2023
3d67b69
[3.12] Sync location of `mypy` pin with the `main` branch (#111317)
art3xa Oct 25, 2023
ed05bf6
[3.12] gh-108590: 8000 Improve sqlite3 docs on encoding issues and how to …
miss-islington Oct 25, 2023
3641dae
[3.12] gh-111165: Add missed "support." prefix for "verbose" (GH-1113…
miss-islington Oct 25, 2023
7cce26b
[3.12] Docs: Add `restart_events()` and positional arg semantics for …
miss-islington Oct 25, 2023
78c6fae
[3.12] gh-111348: Fix direct invocation of `test_doctest`; remove `te…
miss-islington Oct 26, 2023
e25d8b4
GH-111293: Fix DirEntry.inode dropping higher bits on Windows (GH-111…
miss-islington Oct 26, 2023
c81ebf5
[3.12] bpo-43950: handle wide unicode characters in tracebacks (GH-28…
pablogsal Oct 26, 2023
a70b2cd
[3.12] GH-94438: Fix RuntimeWarning for jump tests in test_sys_settra…
miss-islington Oct 26, 2023
307ca78
[3.12] gh-111380: Show SyntaxWarnings only once when parsing if inval…
miss-islington Oct 27, 2023
7d22e85
[3.12] gh-111187: Postpone removal version for locale.getdefaultlocal…
hugovk Oct 27, 2023
2014c23
[3.12] Fix typos in import system docs (GH-111396) (#111397)
miss-islington Oct 27, 2023
883233d
[3.12] gh-111343: Fix `itertools` docs: `start` arg is optional for `…
miss-islington Oct 27, 2023
7132109
[3.12] gh-111276: Clarify docs and comments about the role of LC_CTYP…
miss-islington Oct 27, 2023
754fda8
[3.12] gh-111406: Fix broken link to bpython's site (GH-111407) (#111…
miss-islington Oct 27, 2023
2398036
[3.12] gh-110205: Fix asyncio ThreadedChildWatcher._join_threads() (G…
miss-islington Oct 27, 2023
c3f75b7
[3.12] gh-111342: fix typo in math.sumprod (GH-111416) (gh-111419)
miss-islington Oct 28, 2023
cf29a2f
[3.12] CI: Include Python version in cache.config key (GH-111410) (#1…
miss-islington Oct 28, 2023
2e5d4e2
[3.12] gh-79033: Try to fix asyncio.Server.wait_closed() again (GH-11…
miss-islington Oct 28, 2023
f7ce402
[3.12] gh-111426: Remove `test_cmd.test_coverage` (GH-111427) (#111432)
miss-islington Oct 28, 2023
0681b4c
[3.12] gh-111347: Remove wrong assertion in test_sendfile (GH-111377)…
miss-islington Oct 29, 2023
577c808
[3.12] gh-101100: Fix sphinx warnings in `library/asyncio-eventloop.r…
miss-islington Oct 29, 2023
e5b6744
[3.12] gh-111165: Remove documentation for moved functions (GH-111467…
miss-islington Oct 29, 2023
748bc48
[3.12] gh-108082: C API: Add tests for PyErr_WriteUnraisable() (GH-11…
miss-islington Oct 30, 2023
7ac2c53
[3.12] gh-111284: Make multiprocessing tests with threads faster and …
miss-islington Oct 30, 2023
ca36426
[3.12] gh-111366: Correctly show custom syntax error messages in the …
pablogsal Oct 30, 2023
1675c25
[3.12] Remove myself from typing CODEOWNERS (GH-111523) (#111525)
miss-islington Oct 30, 2023
e820d76
[3.12] gh-111301: Move `importlib.resources.files` change to What's n…
hugovk Oct 31, 2023
dde5a99
[3.12] gh-111531: Tkinter: fix reference leaks in bind_class() and bi…
miss-islington Oct 31, 2023
c21387c
[3.12] gh-106861: Docs: Add availability directives to all Unix-only …
miss-islington Oct 31, 2023
71e138d
[3.12] gh-93607: document `root` attribute of `iterparse` (GH-99410) …
miss-islington Oct 31, 2023
b1da634
[3.12] gh-102249: Expand sys.call_tracing documentation (GH-102806) (…
miss-islington Oct 31, 2023
4f619e8
[3.12] gh-109181: Speed up Traceback object creation by lazily comput…
pablogsal Oct 31, 2023
ec00397
[3.12] gh-111181: Fix enum doctests (GH-111180) (GH-111518)
miss-islington Oct 31, 2023
21c8fbf
[3.12] gh-111282: Fix NamedTemporaryFile example code (GH-111283) (GH…
miss-islington Oct 31, 2023
2162512
[3.12] gh-110367: Make regrtest --verbose3 compatible with --huntrlea…
miss-islington Nov 1, 2023
9619e51
[3.12] gh-111495: add stub files for C API test modules (GH-111586) (…
skirpichev Nov 1, 2023
e255794
[3.12] gh-111576: Improve documention for tkinter.messagebox (GH-1115…
miss-islington Nov 1, 2023
d3d2cfe
[3.12] gh-110968: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED was added to 3…
vstinner Nov 1, 2023
f108785
[3.12] gh-111495: Add tests for PyBytes and PyByteArray C API (GH-111…
miss-islington Nov 1, 2023
a94bdc2
[3.12] gh-111295: Fix error checking in time extension module init (G…
miss-islington Nov 1, 2023
99f0dd8
[3.12] gh-111253: Fix error checking in _socket module init (GH-11125…
miss-islington Nov 1, 2023
9aa8829
[3.12] GH-110894: Call loop exception handler for exceptions in clien…
kumaraditya303 Nov 2, 2023
fcf91cd
[3.12] gh-111625: Fix link to Info-ZIP homepage (GH-111626) (#111639)
miss-islington Nov 2, 2023
1c84a48
[3.12] Fix typo in documentation of `SysLogHandler.createSocket` (GH-…
miss-islington Nov 2, 2023
4db71c3
[3.12] gh-54434: Make difflib.rst doctests pass. (GH-111677) (#111678)
miss-islington Nov 3, 2023
1a95ad6
[3.12] gh-111654: remove redundant decref in LOAD_FROM_DICT_OR_DEREF …
JelleZijlstra Nov 3, 2023
02f8f78
[3.12] gh-111644: Fix support threading_cleanup() (GH-111714) (#111716)
miss-islington Nov 4, 2023
d15fac2
[3.12] gh-111644: Fix asyncio test_unhandled_exceptions() (GH-111713)…
miss-islington Nov 4, 2023
3b839cc
[3.12] gh-111159: Fix `SyntaxError` doctests for non-builtin exceptio…
miss-islington Nov 4, 2023
cd778b4
[3.12] gh-111495: Test C API functions with extreme sizes and indices…
serhiy-storchaka Nov 4, 2023
9c583f3
[3.12] gh-111724: Fix doctest `ResourceWarning` in `howto/descriptor.…
miss-islington Nov 4, 2023
237b269
[3.12] gh-111747: DOC: fix moved link to Documentation Translations (…
miss-islington Nov 5, 2023
fef32a1
[3.12] gh-111495: Add tests for PyFloat C API (GH-111624) (GH-111752)
miss-islington Nov 5, 2023
e0c2bf4
[3.12] gh-111495: Add tests for PyComplex C API (GH-111591) (GH-111753)
miss-islington Nov 5, 2023
c4e524c
[3.12] gh-101180: Fix a bug where iso2022_jp_3 and iso2022_jp_2004 co…
miss-islington Nov 6, 2023
3514184
[3.12] gh-111729: update generic syntax for `typing.Concatenate` samp…
miss-islington Nov 7, 2023
f70ae99
[3.12] gh-111765: Move old PyFloat_* tests to Lib/test/test_capi/test…
miss-islington Nov 7, 2023
d35c945
[3.12] gh-111806: Fix `test_recursion` in `test_richcmp` on WASI buil…
miss-islington Nov 7, 2023
42699c8
[3.12] Glossary: Add "static type checker" (GH-111837) (#111854)
miss-islington Nov 8, 2023
992c3f6
[3.12] gh-108303: Move more typing related files to Lib/test/typingan…
sobolevn Nov 8, 2023
759168a
[3.12] gh-111495: Add tests for PyList C API (GH-111562) (GH-111861)
miss-islington Nov 8, 2023
4f976c3
[3.12] gh-110543: Fix CodeType.replace in presence of comprehensions …
miss-islington Nov 8, 2023
e11ea5a
[3.12] gh-108303: Move config parser data to `Lib/test/configparserda…
miss-islington Nov 9, 2023
e0d827d
[3.12] gh-108303: Move more files to `Lib/test/test_module` (GH-11188…
miss-islington Nov 9, 2023
e983ca8
[3.12] gh-111881: Use lazy import in test.support (#111885) (#111890)
vstinner Nov 9, 2023
5089faf
[3.12] gh-111881: Import doctest lazily in libregrtest (GH-111884) (#…
miss-islington Nov 9, 2023
fe7631e
[3.12] gh-111895: Convert definition list to bullet list for readabil…
miss-islington Nov 9, 2023
09df271
[3.12] gh-110875: Handle '.' properties in logging formatter configur…
miss-islington Nov 9, 2023
5a8e6f8
[3.12] GH-111804: Drop posix.fallocate() under WASI (GH-111869) (GH-1…
brettcannon Nov 9, 2023
4018209
[3.12] gh-109370: Fix unexpected traceback output in test_concurrent_…
serhiy-storchaka Nov 10, 2023
95141aa
gh-111356: io: Add missing documented objects to io.__all__ (GH-111370)
miss-islington Nov 10, 2023
5f42a2b
gh-111929: Fix regrtest --pgo: test_str => test_unicode (#111938)
vstinner Nov 10, 2023
881c9eb
[3.12] gh-108303: Install `Lib/test/configdata` (GH-111899) (#111946)
miss-islington Nov 10, 2023
4b0c875
[3.12] gh-109181: Fix refleak in tb_get_lineno() (#111948)
vstinner Nov 10, 2023
3780414
[3.12] gh-103791: handle `BaseExceptionGroup` in `contextlib.suppress…
miss-islington Nov 10, 2023
41b2d8c
[3.12] gh-111912: Run test_posix on Windows (GH-111913) (GH-111953)
miss-islington Nov 10, 2023
2c6000c
[3.12] gh-111251: Fix error checking in _blake2 module init (GH-11125…
miss-islington Nov 10, 2023
3bd8b74
[3.12] gh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL…
miss-islington Nov 11, 2023
0f7671c
[3.12] gh-110395: invalidate open kqueues after fork (GH-110517) (#11…
gpshead Nov 11, 2023
1afc4dc
[3.12] Fix undefined behaviour in datetime.time.fromisoformat() (GH-1…
miss-islington Nov 12, 2023
13ca1f0
[3.12] gh-111777: Fix assertion errors on incorrectly still-tracked G…
miss-islington Nov 12, 2023
158a7e1
[3.12] gh-111933: fix broken link to A.Neumaier article (gh-111937) (…
miss-islington Nov 12, 2023
378a96e
[3.12] gh-112001: Fix test_builtins_have_signatures in test_inspect (…
miss-islington Nov 12, 2023
3b7e308
[3.12] gh-111944: Add assignment expression parentheses requirements …
miss-islington Nov 13, 2023
a1447af
[3.12] Docs: Add `make htmllive` to rebuild and reload HTML files in …
miss-islington Nov 13, 2023
7313bde
[3.12] Bump mypy to 1.7.0 (GH-111961) (#112033)
AlexWaygood Nov 13, 2023
9aa5ff8
[3.12] gh-111681: minor fixes to typing doctests; remove unused impor…
AlexWaygood Nov 13, 2023
c6aea46
[3.12] gh-102837: more tests for the math module (GH-111930)(GH-10252…
encukou Nov 13, 2023
dfdbfc5
gh-111856: Fix os.fstat on windows with FAT32 and exFAT filesystem (G…
miss-islington Nov 13, 2023
02fdb42
[3.12] gh-112007: Re-organize help utility intro message (GH-112017) …
miss-islington Nov 13, 2023
d34650e
[3.12] gh-111460: Restore ncurses widechar support on macOS (GH-11187…
miss-islington Nov 14, 2023
18b88fe
[3.12] gh-111622: Fix doc for items views (GH-112051) (#112052)
miss-islington Nov 14, 2023
c003de9
[3.12] gh-110944: Move pty helper to test.support and add basic pdb c…
miss-islington Nov 14, 2023
24216d0
[3.12] gh-111942: Fix crashes in TextIOWrapper.reconfigure() (GH-1119…
miss-islington Nov 14, 2023
c190552
[3.12] Docs: Add the time to the HTML last updated format (GH-110091)…
miss-islington Nov 15, 2023
91a33fd
[3.12] gh-108303: Delete `imp_dummy` test file (GH-112110) (#112114)
miss-islington Nov 15, 2023
1445d77
[3.12] gh-111942: Fix SystemError in the TextIOWrapper constructor (G…
vstinner Nov 15, 2023
77f59bf
[3.12] Fix typo in perf profiling docs (GH-112112) (#112117)
miss-islington Nov 15, 2023
427cf61
[3.12] gh-111062: CI: Move OS test jobs to reusable workflows (gh-111…
hugovk Nov 16, 2023
2e17a81
[3.12] gh-110812: Isolating Extension Modules HOWTO: List GC-related …
miss-islington Nov 16, 2023
a498433
[3.12] gh-112088: Run autoreconf in GHA check_generated_files (GH-112…
vstinner Nov 16, 2023
458a3c0
[3.12] GH-112152: Fix typo in `typing.override` docstring (GH-112158)…
miss-islington Nov 16, 2023
3f2cdbe
[3.12] gh-111811: Fix test_recursive_repr for WASI (GH-112130) (#112131)
miss-islington Nov 16, 2023
2ef3676
[3.12] gh-109538: Catch closed loop runtime error and issue warning (…
dpr-0 Nov 16, 2023
8e37445
[3.12] Remove `imp_dummy_def` from `Tools/c-analyzer/cpython/ignored.…
miss-islington Nov 16, 2023
94bac1c
[3.12] gh-112165: Fix typo in `__main__.py` (GH-112183) (#112184)
miss-islington Nov 17, 2023
976488e
[3.12] gh-94309: "What's new in Python 3.12": improve deprecation not…
miss-islington Nov 17, 2023
0ea6454
[3.12] gh-112194: Convert more examples to doctests in `typing.py` (G…
miss-islington Nov 17, 2023
919be35
[3.12] gh-112155: Run `typing.py` doctests during tests (GH-112156) (…
sobolevn Nov 18, 2023
a62dcac
[3.12] gh-79871: IDLE - Fix and test debugger module (GH-11451) (#112…
miss-islington Nov 19, 2023
89c5180
[3.12] IDLE: Fix test_debugger bug and buildbot failures (GH-112258) …
miss-islington Nov 19, 2023
5134f66
[3.12] gh-110383: Fix documentation profile cumtime fix (GH-112221) (…
miss-islington Nov 19, 2023
dedbd26
[3.12] gh-110383: Explained which error message is generated when the…
miss-islington Nov 19, 2023
f521321
[3.12] gh-112186: Improve test case `test_loop_is_closed_resource_war…
miss-islington Nov 19, 2023
cf8c830
[3.12] gh-112266: Remove `(if defined)` part from `__dict__` and `__w…
miss-islington Nov 19, 2023
c7c5cd4
Merge branch '3.12' into tag-strings-v2
gvanrossum Dec 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[3.12] GH-101100: Fix reference warnings for __enter__ and ``__ex…
…it__`` (GH-110112) (#111075)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
  • Loading branch information
miss-islington and AA-Turner authored Oct 19, 2023
commit 91a6e98e927ac529adeff57d33e87abcf448efec
2 changes: 1 addition & 1 deletion Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Glossary

context manager
An object which controls the environment seen in a :keyword:`with`
statement by defining :meth:`__enter__` and :meth:`__exit__` methods.
statement by defining :meth:`~object.__enter__` and :meth:`~object.__exit__` methods.
See :pep:`343`.

context variable
Expand Down
22 changes: 11 additions & 11 deletions Doc/library/contextlib.rst
F438
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Functions and classes provided:

This function is a :term:`decorator` that can be used to define a factory
function for :keyword:`with` statement context managers, without needing to
create a class or separate :meth:`__enter__` and :meth:`__exit__` methods.
create a class or separate :meth:`~object.__enter__` and :meth:`~object.__exit__` methods.

While many objects natively support use in with statements, sometimes a
resource needs to be managed that isn't a context manager in its own right,
Expand Down Expand Up @@ -515,7 +515,7 @@ Functions and classes provided:
# the with statement, even if attempts to open files later
# in the list raise an exception

The :meth:`__enter__` method returns the :class:`ExitStack` instance, and
The :meth:`~object.__enter__` method returns the :class:`ExitStack` instance, and
performs no additional operations.

Each instance maintains a stack of registered callbacks that are called in
Expand Down Expand Up @@ -543,9 +543,9 @@ Functions and classes provided:

.. method:: enter_context(cm)

Enters a new context manager and adds its :meth:`__exit__` method to
Enters a new context manager and adds its :meth:`~object.__exit__` method to
the callback stack. The return value is the result of the context
manager's own :meth:`__enter__` method.
manager's own :meth:`~object.__enter__` method.

These context managers may suppress exceptions just as they normally
would if used directly as part of a :keyword:`with` statement.
Expand All @@ -556,18 +556,18 @@ Functions and classes provided:

.. method:: push(exit)

Adds a context manager's :meth:`__exit__` method to the callback stack.
Adds a context manager's :meth:`~object.__exit__` method to the callback stack.

As ``__enter__`` is *not* invoked, this method can be used to cover
part of an :meth:`__enter__` implementation with a context manager's own
:meth:`__exit__` method.
part of an :meth:`~object.__enter__` implementation with a context manager's own
:meth:`~object.__exit__` method.

If passed an object that is not a context manager, this method assumes
it is a callback with the same signature as a context manager's
:meth:`__exit__` method and adds it directly to the callback stack.
:meth:`~object.__exit__` method and adds it directly to the callback stack.

By returning true values, these callbacks can suppress exceptions the
same way context manager :meth:`__exit__` methods can.
same way context manager :meth:`~object.__exit__` methods can.

The passed in object is returned from the function, allowing this
method to be used as a function decorator.
Expand Down Expand Up @@ -714,7 +714,7 @@ Cleaning up in an ``__enter__`` implementation

As noted in the documentation of :meth:`ExitStack.push`, this
method can be useful in cleaning up an already allocated resource if later
steps in the :meth:`__enter__` implementation fail.
steps in the :meth:`~object.__enter__` implementation fail.

Here's an example of doing this for a context manager that accepts resource
acquisition and release functions, along with an optional validation function,
Expand Down Expand Up @@ -871,7 +871,7 @@ And also as a function decorator::

Note that there is one additional limitation when using context managers
as function decorators: there's no way to access the return value of
:meth:`__enter__`. If that value is needed, then it is still necessary to use
:meth:`~object.__enter__`. If that value is needed, then it is still necessary to use
an explicit ``with`` statement.

.. seealso::
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4854,7 +4854,7 @@ before the statement body is executed and exited when the statement ends:
The exception passed in should never be reraised explicitly - instead, this
method should return a false value to indicate that the method completed
successfully and does not want to suppress the raised exception. This allows
context management code to easily detect whether or not an :meth:`__exit__`
context management code to easily detect whether or not an :meth:`~object.__exit__`
method has actually failed.

Python defines several context managers to support easy thread synchronisation,
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ The :mod:`test.support` module defines the following classes:
:const:`resource.RLIMIT_CORE`'s soft limit to 0 to prevent coredump file
creation.

On both platforms, the old value is restored by :meth:`__exit__`.
On both platforms, the old value is restored by :meth:`~object.__exit__`.


.. class:: SaveSignals()
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2482,8 +2482,8 @@ are closed properly and is becoming common::
f.write('something')

The issue is that even if you mock out the call to :func:`open` it is the
*returned object* that is used as a context manager (and has :meth:`__enter__` and
:meth:`__exit__` called).
*returned object* that is used as a context manager (and has :meth:`~object.__enter__` and
:meth:`~object.__exit__` called).

Mocking context managers with a :class:`MagicMock` is common enough and fiddly
enough that a helper function is useful. ::
Expand Down
20 changes: 10 additions & 10 deletions Doc/reference/compound_stmts.rst
10000
Original file line number Diff line number Diff line change
Expand Up @@ -489,37 +489,37 @@ The execution of the :keyword:`with` statement with one "item" proceeds as follo
#. The context expression (the expression given in the
:token:`~python-grammar:with_item`) is evaluated to obtain a context manager.

#. The context manager's :meth:`__enter__` is loaded for later use.
#. The context manager's :meth:`~object.__enter__` is loaded for later use.

#. The context manager's :meth:`__exit__` is loaded for later use.
#. The context manager's :meth:`~object.__exit__` is loaded for later use.

#. The context manager's :meth:`__enter__` method is invoked.
#. The context manager's :meth:`~object.__enter__` method is invoked.

#. If a target was included in the :keyword:`with` statement, the return value
from :meth:`__enter__` is assigned to it.
from :meth:`~object.__enter__` is assigned to it.

.. note::

The :keyword:`with` statement guarantees that if the :meth:`__enter__`
method returns without an error, then :meth:`__exit__` will always be
The :keyword:`with` statement guarantees that if the :meth:`~object.__enter__`
method returns without an error, then :meth:`~object.__exit__` will always be
called. Thus, if an error occurs during the assignment to the target list,
it will be treated the same as an error occurring within the suite would
be. See step 7 below.

#. The suite is executed.

#. The context manager's :meth:`__exit__` method is invoked. If an exception
#. The context manager's :meth:`~object.__exit__` method is invoked. If an exception
caused the suite to be exited, its type, value, and traceback are passed as
arguments to :meth:`__exit__`. Otherwise, three :const:`None` arguments are
arguments to :meth:`~object.__exit__`. Otherwise, three :const:`None` arguments are
supplied.

If the suite was exited due to an exception, and the return value from the
:meth:`__exit__` method was false, the exception is reraised. If the return
:meth:`~object.__exit__` method was false, the exception is reraised. If the return
value was true, the exception is suppressed, and execution continues with the
statement following the :keyword:`with` statement.

If the suite was exited for any reason other than an exception, the return
value from :meth:`__exit__` is ignored, and execution proceeds at the normal
value from :meth:`~object.__exit__` is ignored, and execution proceeds at the normal
location for the kind of exit that was taken.

The following code::
Expand Down
6 changes: 3 additions & 3 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2939,7 +2939,7 @@ For more information on context managers, see :ref:`typecontextmanager`.
(i.e., prevent it from being propagated), it should return a true value.
Otherwise, the exception will be processed normally upon exit from this method.

Note that :meth:`__exit__` methods should not reraise the passed-in exception;
Note that :meth:`~object.__exit__` methods should not reraise the passed-in exception;
this is the caller's responsibility.


Expand Down Expand Up @@ -3257,12 +3257,12 @@ Asynchronous context managers can be used in an :keyword:`async with` statement.

.. method:: object.__aenter__(self)

Semantically similar to :meth:`__enter__`, the only
Semantically similar to :meth:`~object.__enter__`, the only
difference being that it must return an *awaitable*.

.. method:: object.__aexit__(self, exc_type, exc_value, traceback)

Semantically similar to :meth:`__exit__`, the only
Semantically similar to :meth:`~object.__exit__`, the only
difference being that it must return an *awaitable*.

An example of an asynchronous context manager class::
Expand Down
22 changes: 11 additions & 11 deletions Doc/whatsnew/2.5.rst
D7AE
Original file line number Diff line number Diff line change
Expand Up @@ -575,15 +575,15 @@ structure is::
with-block

The expression is evaluated, and it should result in an object that supports the
context management protocol (that is, has :meth:`__enter__` and :meth:`__exit__`
context management protocol (that is, has :meth:`~object.__enter__` and :meth:`~object.__exit__`
methods.

The object's :meth:`__enter__` is called before *with-block* is executed and
The object's :meth:`~object.__enter__` is called before *with-block* is executed and
therefore can run set-up code. It also may return a value that is bound to the
name *variable*, if given. (Note carefully that *variable* is *not* assigned
the result of *expression*.)

After execution of the *with-block* is finished, the object's :meth:`__exit__`
After execution of the *with-block* is finished, the object's :meth:`~object.__exit__`
method is called, even if the block raised an exception, and can therefore run
clean-up code.

Expand All @@ -609,7 +609,7 @@ part-way through the block.
.. note::

In this case, *f* is the same object created by :func:`open`, because
:meth:`file.__enter__` returns *self*.
:meth:`~object.__enter__` returns *self*.

The :mod:`threading` module's locks and condition variables also support the
':keyword:`with`' statement::
Expand Down Expand Up @@ -652,10 +652,10 @@ underlying implementation and should keep reading.
A high-level explanation of the context management protocol is:

* The expression is evaluated and should result in an object called a "context
manager". The context manager must have :meth:`__enter__` and :meth:`__exit__`
manager". The context manager must have :meth:`~object.__enter__` and :meth:`~object.__exit__`
methods.

* The context manager's :meth:`__enter__` method is called. The value returned
* The context manager's :meth:`~object.__enter__` method is called. The value returned
is assigned to *VAR*. If no ``'as VAR'`` clause is present, the value is simply
discarded.

Expand All @@ -669,7 +669,7 @@ A high-level explanation of the context management protocol is:
if you do the author of the code containing the ':keyword:`with`' statement will
never realize anything went wrong.

* If *BLOCK* didn't raise an exception, the :meth:`__exit__` method is still
* If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method is still
called, but *type*, *value*, and *traceback* are all ``None``.

Let's think through an example. I won't present detailed code but will only
Expand Down Expand Up @@ -703,7 +703,7 @@ rolled back if there's an exception. Here's the basic interface for
def rollback (self):
"Rolls back current transaction"

The :meth:`__enter__` method is pretty easy, having only to start a new
The :meth:`~object.__enter__` method is pretty easy, having only to start a new
transaction. For this application the resulting cursor object would be a useful
result, so the method will return it. The user can then add ``as cursor`` to
their ':keyword:`with`' statement to bind the cursor to a variable name. ::
Expand All @@ -715,7 +715,7 @@ their ':keyword:`with`' statement to bind the cursor to a variable name. ::
cursor = self.cursor()
return cursor

The :meth:`__exit__` method is the most complicated because it's where most of
The :meth:`~object.__exit__` method is the most complicated because it's where most of
the work has to be done. The method has to check if an exception occurred. If
there was no exception, the transaction is committed. The transaction is rolled
back if there was an exception.
Expand Down Expand Up @@ -748,10 +748,10 @@ are useful for writing objects for use with the ':keyword:`with`' statement.
The decorator is called :func:`contextmanager`, and lets you write a single
generator function instead of defining a new class. The generator should yield
exactly one value. The code up to the :keyword:`yield` will be executed as the
:meth:`__enter__` method, and the value yielded will be the method's return
:meth:`~object.__enter__` method, and the value yielded will be the method's return
value that will get bound to the variable in the ':keyword:`with`' statement's
:keyword:`!as` clause, if any. The code after the :keyword:`yield` will be
executed in the :meth:`__exit__` method. Any exception raised in the block will
executed in the :meth:`~object.__exit__` method. Any exception raised in the block will
be raised by the :keyword:`!yield` statement.

Our database example from the previous section could be written using this
Expand Down
26 changes: 13 additions & 13 deletions Doc/whatsnew/2.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,15 @@ structure is::
with-block

The expression is evaluated, and it should result in an object that supports the
context management protocol (that is, has :meth:`__enter__` and :meth:`__exit__`
context management protocol (that is, has :meth:`~object.__enter__` and :meth:`~object.__exit__`
methods).

The object's :meth:`__enter__` is called before *with-block* is executed and
The object's :meth:`~object.__enter__` is called before *with-block* is executed and
therefore can run set-up code. It also may return a value that is bound to the
name *variable*, if given. (Note carefully that *variable* is *not* assigned
the result of *expression*.)

After execution of the *with-block* is finished, the object's :meth:`__exit__`
After execution of the *with-block* is finished, the object's :meth:`~object.__exit__`
method is called, even if the block raised an exception, and can therefore run
clean-up code.

Expand All @@ -296,7 +296,7 @@ part-way through the block.
.. note::

In this case, *f* is the same object created by :func:`open`, because
:meth:`file.__enter__` returns *self*.
:meth:`~object.__enter__` returns *self*.

The :mod:`threading` module's locks and condition variables also support the
':keyword:`with`' statement::
Expand Down Expand Up @@ -339,16 +339,16 @@ underlying implementation and should keep reading.
A high-level explanation of the context management protocol is:

* The expression is evaluated and should result in an object called a "context
manager". The context manager must have :meth:`__enter__` and :meth:`__exit__`
manager". The context manager must have :meth:`~object.__enter__` and :meth:`~object.__exit__`
methods.

* The context manager's :meth:`__enter__` method is called. The value returned
* The context manager's :meth:`~object.__enter__` method is called. The value returned
is assigned to *VAR*. If no ``as VAR`` clause is present, the value is simply
discarded.

* The code in *BLOCK* is executed.

* If *BLOCK* raises an exception, the context manager's :meth:`__exit__` method
* If *BLOCK* raises an exception, the context manager's :meth:`~object.__exit__` method
is called with three arguments, the exception details (``type, value, traceback``,
the same values returned by :func:`sys.exc_info`, which can also be ``None``
if no exception occurred). The method's return value controls whether an exception
Expand All @@ -357,7 +357,7 @@ A high-level explanation of the context management protocol is:
if you do the author of the code containing the ':keyword:`with`' statement will
never realize anything went wrong.

* If *BLOCK* didn't raise an exception, the :meth:`__exit__` method is still
* If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method is still
called, but *type*, *value*, and *traceback* are all ``None``.

Let's think through an example. I won't present detailed code but will only
Expand Down Expand Up @@ -391,7 +391,7 @@ rolled back if there's an exception. Here's the basic interface for
def rollback(self):
"Rolls back current transaction"

The :meth:`__enter__` method is pretty easy, having only to start a new
The :meth:`~object.__enter__` method is pretty easy, having only to start a new
transaction. For this application the resulting cursor object would be a useful
result, so the method will return it. The user can then add ``as cursor`` to
their ':keyword:`with`' statement to bind the cursor to a variable name. ::
Expand All @@ -403,7 +403,7 @@ their ':keyword:`with`' statement to bind the cursor to a variable name. ::
cursor = self.cursor()
return cursor

The :meth:`__exit__` method is the most complicated because it's where most of
The :meth:`~object.__exit__` method is the most complicated because it's where most of
the work has to be done. The method has to check if an exception occurred. If
there was no exception, the transaction is committed. The transaction is rolled
back if there was an exception.
Expand Down Expand Up @@ -436,10 +436,10 @@ are useful when writing objects for use with the ':keyword:`with`' statement.
The decorator is called :func:`contextmanager`, and lets you write a single
generator function instead of defining a new class. The generator should yield
exactly one value. The code up to the :keyword:`yield` will be executed as the
:meth:`__enter__` method, and the value yielded will be the method's return
:meth:`~object.__enter__` method, and the value yielded will be the method's return
value that will get bound to the variable in the ':keyword:`with`' statement's
:keyword:`!as` clause, if any. The code after the :keyword:`!yield` will be
executed in the :meth:`__exit__` method. Any exception raised in the block will
executed in the :meth:`~object.__exit__` method. Any exception raised in the block will
be raised by the :keyword:`!yield` statement.

Using this decorator, our database example from the previous section
Expand Down Expand Up @@ -1737,7 +1737,7 @@ Optimizations
(Contributed by Antoine Pitrou.) Memory usage is reduced
by using pymalloc for the Unicode string's data.

* The ``with`` statement now stores the :meth:`__exit__` method on the stack,
* The ``with`` statement now stores the :meth:`~object.__exit__` method on the stack,
producing a small speedup. (Implemented by Jeffrey Yasskin.)

* To reduce memory usage, the garbage collector will now clear internal
Expand Down
Loading
0