Python Modules & Metadata
Modules & Metadata — Import system, packages, virtual envs, locale, netrc, gettext. This group brings together the Importlib Module, Pkgutil Module, Compileall Module, Zipapp Module, Venv Module, Netrc Module, Gettext Module, Locale Module, Copy Module, Pprint Module, Struct Module, Contextlib Module categories of the Python standard library. copy.copy() returns a shallow copy of object x. Nested objects are not copied — they are referenced. copy.deepcopy() returns a deep copy of object x (recursively copies all nested objects). contextlib.contextmanager() a decorator that creates a context manager from a generator function. contextlib.suppress() a context manager that suppresses specified exceptions. contextlib.redirect_stdout() redirects sys.stdout to a file or StringIO. Representative APIs from this group include copy.copy(), copy.deepcopy(), contextlib.contextmanager(), contextlib.suppress(), contextlib.redirect_stdout(), contextlib.redirect_stderr(), contextlib.closing(), contextlib.nullcontext(). Each category page in this group lists its functions with syntax, parameters, return values, and runnable examples, so the group works as a map of a whole area of the standard library.