summaryrefslogtreecommitdiffstats
path: root/Doc/glossary.rst
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2014-12-07 00:28:27 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2014-12-07 00:28:27 (GMT)
commit5db1bb81ff88c90364cfcf458bae8115126411d8 (patch)
tree334a5d67f565b3a103f068a82147b6bede9e1b20 /Doc/glossary.rst
parentb9859daeeb8ad767d2b2cc56f72736810114dd49 (diff)
downloadcpython-5db1bb81ff88c90364cfcf458bae8115126411d8.zip
cpython-5db1bb81ff88c90364cfcf458bae8115126411d8.tar.gz
cpython-5db1bb81ff88c90364cfcf458bae8115126411d8.tar.bz2
Issue #22696: Add function :func:`sys.is_finalizing` to know about interpreter shutdown.
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r--Doc/glossary.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index 92877bd..87e2d8a 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -402,6 +402,19 @@ Glossary
than compiled ones, though their programs generally also run more
slowly. See also :term:`interactive`.
+ interpreter shutdown
+ When asked to shut down, the Python interpreter enters a special phase
+ where it gradually releases all allocated resources, such as modules
+ and various critical internal structures. It also makes several calls
+ to the :term:`garbage collector <garbage collection>`. This can trigger
+ the execution of code in user-defined destructors or weakref callbacks.
+ Code executed during the shutdown phase can encounter various
+ exceptions as the resources it relies on may not function anymore
+ (common examples are library modules or the warnings machinery).
+
+ The main reason for interpreter shutdown is that the ``__main__`` module
+ or the script being run has finished executing.
+
iterable
An object capable of returning its members one at a time. Examples of
iterables include all sequence types (such as :class:`list`, :class:`str`,