8000 gh-99633: Add "context management protocol" to glossary · rhansen/cpython@713d4fe · GitHub
[go: up one dir, main page]

Skip to content

Commit 713d4fe

Browse files
committed
pythongh-99633: Add "context management protocol" to glossary
1 parent b02301f commit 713d4fe

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Doc/glossary.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,14 @@ Glossary
243243
advanced mathematical feature. If you're not aware of a need for them,
244244
it's almost certain you can safely ignore them.
245245

246+
context management protocol
247+
The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called
248+
by the :keyword:`with` statement. See :pep:`343`.
249+
246250
context manager
247-
An object which controls the environment seen in a :keyword:`with`
248-
statement by defining :meth:`~object.__enter__` and :meth:`~object.__exit__` methods.
249-
See :pep:`343`.
251+
An object which implements the :term:`context management protocol` and
252+
controls the environment seen in a :keyword:`with` statement. See
253+
:pep:`343`.
250254

251255
context variable
252256
A variable which can have different values depending on its context.

0 commit comments

Comments
 (0)
0