29. Python Runtime Services¶
The modules described in this chapter provide a wide range of services related to the Python interpreter and its interaction with its environment. Hereâs an overview:
- 29.1.
sysâ System-specific parameters and functions - 29.2.
sysconfigâ Provide access to Pythonâs configuration information - 29.3.
builtinsâ Built-in objects - 29.4.
__main__â Top-level script environment - 29.5.
warningsâ Warning control - 29.6.
contextlibâ Utilities forwith-statement contexts- 29.6.1. Utilities
- 29.6.2. Examples and Recipes
- 29.6.2.1. Supporting a variable number of context managers
- 29.6.2.2. Simplifying support for single optional context managers
- 29.6.2.3. Catching exceptions from
__enter__methods - 29.6.2.4. Cleaning up in an
__enter__implementation - 29.6.2.5. Replacing any use of
try-finallyand flag variables - 29.6.2.6. Using a context manager as a function decorator
- 29.6.3. Single use, reusable and reentrant context managers
- 29.7.
abcâ Abstract Base Classes - 29.8.
atexitâ Exit handlers - 29.9.
tracebackâ Print or retrieve a stack traceback - 29.10.
__future__â Future statement definitions - 29.11.
gcâ Garbage Collector interface - 29.12.
inspectâ Inspect live objects- 29.12.1. Types and members
- 29.12.2. Retrieving source code
- 29.12.3. Introspecting callables with the Signature object
- 29.12.4. Classes and functions
- 29.12.5. The interpreter stack
- 29.12.6. Fetching attributes statically
- 29.12.7. Current State of Generators and Coroutines
- 29.12.8. Code Objects Bit Flags
- 29.12.9. Command Line Interface
- 29.13.
siteâ Site-specific configuration hook - 29.14.
fpectlâ Floating point exception control
