Restoration of the ``rot13`` alias.
-:mod:`encodings` --- Encodings package
---------------------------------------
+:mod:`!encodings` --- Encodings package
+---------------------------------------
.. module:: encodings
:synopsis: Encodings package
Raised when a codec is invalid or incompatible.
-:mod:`encodings.idna` --- Internationalized Domain Names in Applications
-------------------------------------------------------------------------
+:mod:`!encodings.idna` --- Internationalized Domain Names in Applications
+-------------------------------------------------------------------------
.. module:: encodings.idna
:synopsis: Internationalized Domain Names implementation
automatic conversion to Unicode is performed: applications wishing to present
such host names to the user should decode them to Unicode.
-The module :mod:`encodings.idna` also implements the nameprep procedure, which
+The module :mod:`!encodings.idna` also implements the nameprep procedure, which
performs certain normalizations on host names, to achieve case-insensitivity of
international domain names, and to unify similar characters. The nameprep
functions can be used directly if desired.
Convert a label to Unicode, as specified in :rfc:`3490`.
-:mod:`encodings.mbcs` --- Windows ANSI codepage
------------------------------------------------
+:mod:`!encodings.mbcs` --- Windows ANSI codepage
+------------------------------------------------
.. module:: encodings.mbcs
:synopsis: Windows ANSI codepage
Support any error handler.
-:mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature
--------------------------------------------------------------
+:mod:`!encodings.utf_8_sig` --- UTF-8 codec with BOM signature
+--------------------------------------------------------------
.. module:: encodings.utf_8_sig
:synopsis: UTF-8 codec with BOM signature
+-------------------------+----------------------------+
-:mod:`curses.textpad` --- Text input widget for curses programs
-===============================================================
+:mod:`!curses.textpad` --- Text input widget for curses programs
+================================================================
.. module:: curses.textpad
:synopsis: Emacs-like input editing in a curses window.
.. sectionauthor:: Eric Raymond <esr@thyrsus.com>
-The :mod:`curses.textpad` module provides a :class:`Textbox` class that handles
+The :mod:`!curses.textpad` module provides a :class:`Textbox` class that handles
elementary text editing in a curses window, supporting a set of keybindings
resembling those of Emacs (thus, also of Netscape Navigator, BBedit 6.x,
FrameMaker, and many other programs). The module also provides a
rectangle-drawing function useful for framing text boxes or for other purposes.
-The module :mod:`curses.textpad` defines the following function:
+The module :mod:`!curses.textpad` defines the following function:
.. function:: rectangle(win, uly, ulx, lry, lrx)
The individual submodules are described in the following sections.
-:mod:`dbm.sqlite3` --- SQLite backend for dbm
----------------------------------------------
+:mod:`!dbm.sqlite3` --- SQLite backend for dbm
+----------------------------------------------
.. module:: dbm.sqlite3
:platform: All
This module uses the standard library :mod:`sqlite3` module to provide an
SQLite backend for the :mod:`!dbm` module.
-The files created by :mod:`dbm.sqlite3` can thus be opened by :mod:`sqlite3`,
+The files created by :mod:`!dbm.sqlite3` can thus be opened by :mod:`sqlite3`,
or any other SQLite browser, including the SQLite CLI.
.. include:: ../includes/wasm-notavail.rst
.. versionadded:: 3.15
-:mod:`dbm.gnu` --- GNU database manager
----------------------------------------
+:mod:`!dbm.gnu` --- GNU database manager
+----------------------------------------
.. module:: dbm.gnu
:platform: Unix
--------------
-The :mod:`dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU dbm)`
+The :mod:`!dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU dbm)`
library, similar to the :mod:`dbm.ndbm` module, but with additional
functionality like crash tolerance.
.. note::
- The file formats created by :mod:`dbm.gnu` and :mod:`dbm.ndbm` are incompatible
+ The file formats created by :mod:`!dbm.gnu` and :mod:`dbm.ndbm` are incompatible
and can not be used interchangeably.
.. include:: ../includes/wasm-mobile-notavail.rst
.. exception:: error
- Raised on :mod:`dbm.gnu`-specific errors, such as I/O errors. :exc:`KeyError` is
+ Raised on :mod:`!dbm.gnu`-specific errors, such as I/O errors. :exc:`KeyError` is
raised for general mapping errors like specifying an incorrect key.
unwritten data to be written to the disk.
-:mod:`dbm.ndbm` --- New Database Manager
-----------------------------------------
+:mod:`!dbm.ndbm` --- New Database Manager
+-----------------------------------------
.. module:: dbm.ndbm
:platform: Unix
--------------
-The :mod:`dbm.ndbm` module provides an interface to the
+The :mod:`!dbm.ndbm` module provides an interface to the
:abbr:`NDBM (New Database Manager)` library.
This module can be used with the "classic" NDBM interface or the
:abbr:`GDBM (GNU dbm)` compatibility interface.
.. note::
- The file formats created by :mod:`dbm.gnu` and :mod:`dbm.ndbm` are incompatible
+ The file formats created by :mod:`dbm.gnu` and :mod:`!dbm.ndbm` are incompatible
and can not be used interchangeably.
.. warning::
.. exception:: error
- Raised on :mod:`dbm.ndbm`-specific errors, such as I/O errors. :exc:`KeyError` is raised
+ Raised on :mod:`!dbm.ndbm`-specific errors, such as I/O errors. :exc:`KeyError` is raised
for general mapping errors like specifying an incorrect key.
Close the NDBM database.
-:mod:`dbm.dumb` --- Portable DBM implementation
------------------------------------------------
+:mod:`!dbm.dumb` --- Portable DBM implementation
+------------------------------------------------
.. module:: dbm.dumb
:synopsis: Portable implementation of the simple DBM interface.
.. note::
- The :mod:`dbm.dumb` module is intended as a last resort fallback for the
- :mod:`!dbm` module when a more robust module is not available. The :mod:`dbm.dumb`
+ The :mod:`!dbm.dumb` module is intended as a last resort fallback for the
+ :mod:`!dbm` module when a more robust module is not available. The :mod:`!dbm.dumb`
module is not written for speed and is not nearly as heavily used as the other
database modules.
--------------
-The :mod:`dbm.dumb` module provides a persistent :class:`dict`-like
+The :mod:`!dbm.dumb` module provides a persistent :class:`dict`-like
interface which is written entirely in Python.
Unlike other :mod:`!dbm` backends, such as :mod:`dbm.gnu`, no
external library is required.
.. exception:: error
- Raised on :mod:`dbm.dumb`-specific errors, such as I/O errors. :exc:`KeyError` is
+ Raised on :mod:`!dbm.dumb`-specific errors, such as I/O errors. :exc:`KeyError` is
raised for general mapping errors like specifying an incorrect key.
Python's AST compiler.
.. warning::
- :mod:`dbm.dumb` does not support concurrent read/write access. (Multiple
+ :mod:`!dbm.dumb` does not support concurrent read/write access. (Multiple
simultaneous read accesses are safe.) When a program has the database open
for writing, no other program should have it open for reading or writing.
Tkinter Dialogs
===============
-:mod:`tkinter.simpledialog` --- Standard Tkinter input dialogs
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+:mod:`!tkinter.simpledialog` --- Standard Tkinter input dialogs
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. module:: tkinter.simpledialog
:platform: Tk
--------------
-The :mod:`tkinter.simpledialog` module contains convenience classes and
+The :mod:`!tkinter.simpledialog` module contains convenience classes and
functions for creating simple modal dialogs to get a value from the user.
-:mod:`tkinter.filedialog` --- File selection dialogs
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+:mod:`!tkinter.filedialog` --- File selection dialogs
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. module:: tkinter.filedialog
:platform: Tk
--------------
-The :mod:`tkinter.filedialog` module provides classes and factory functions for
+The :mod:`!tkinter.filedialog` module provides classes and factory functions for
creating file/directory selection windows.
Native Load/Save Dialogs
directory. Confirmation is required if an already existing file is
selected.
-:mod:`tkinter.commondialog` --- Dialog window templates
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+:mod:`!tkinter.commondialog` --- Dialog window templates
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. module:: tkinter.commondialog
:platform: Tk
--------------
-The :mod:`tkinter.commondialog` module provides the :class:`Dialog` class that
+The :mod:`!tkinter.commondialog` module provides the :class:`Dialog` class that
is the base class for dialogs defined in other supporting modules.
.. class:: Dialog(master=None, **options)
containing binary data.
The :mod:`email` package provides some convenient encoders in its
-:mod:`~email.encoders` module. These encoders are actually used by the
+:mod:`!encoders` module. These encoders are actually used by the
:class:`~email.mime.audio.MIMEAudio` and :class:`~email.mime.image.MIMEImage`
class constructors to provide default encodings. All encoder functions take
exactly one argument, the message object to encode. They usually extract the
This concrete :class:`Policy` is the backward compatibility policy. It
replicates the behavior of the email package in Python 3.2. The
- :mod:`~email.policy` module also defines an instance of this class,
+ :mod:`!policy` module also defines an instance of this class,
:const:`compat32`, that is used as the default policy. Thus the default
behavior of the email package is to maintain compatibility with Python 3.2.
in unexpected behavior. It's recommended to use the :class:`threading.Lock`
or other synchronization primitives for thread-safe module reloading.
-:mod:`importlib.abc` -- Abstract base classes related to import
----------------------------------------------------------------
+:mod:`!importlib.abc` -- Abstract base classes related to import
+----------------------------------------------------------------
.. module:: importlib.abc
:synopsis: Abstract base classes related to import
--------------
-The :mod:`importlib.abc` module contains all of the core abstract base classes
+The :mod:`!importlib.abc` module contains all of the core abstract base classes
used by :keyword:`import`. Some subclasses of the core abstract base classes
are also provided to help in implementing the core ABCs.
itself does not end in ``__init__``.
-:mod:`importlib.machinery` -- Importers and path hooks
-------------------------------------------------------
+:mod:`!importlib.machinery` -- Importers and path hooks
+-------------------------------------------------------
.. module:: importlib.machinery
:synopsis: Importers and path hooks
Path to the ``.fwork`` file for the extension module.
-:mod:`importlib.util` -- Utility code for importers
----------------------------------------------------
+:mod:`!importlib.util` -- Utility code for importers
+----------------------------------------------------
.. module:: importlib.util
:synopsis: Utility code for importers
--------------
The :mod:`!json` module can be invoked as a script via ``python -m json``
-to validate and pretty-print JSON objects. The :mod:`json.tool` submodule
+to validate and pretty-print JSON objects. The :mod:`!json.tool` submodule
implements this interface.
If the optional ``infile`` and ``outfile`` arguments are not
p.join()
Queues are thread and process safe.
- Any object put into a :mod:`~multiprocessing` queue will be serialized.
+ Any object put into a :mod:`!multiprocessing` queue will be serialized.
**Pipes**
attributes which allow one to use it to store and retrieve strings.
-The :mod:`multiprocessing.sharedctypes` module
-""""""""""""""""""""""""""""""""""""""""""""""
+The :mod:`!multiprocessing.sharedctypes` module
+"""""""""""""""""""""""""""""""""""""""""""""""
.. module:: multiprocessing.sharedctypes
:synopsis: Allocate ctypes objects from shared memory.
-The :mod:`multiprocessing.sharedctypes` module provides functions for allocating
+The :mod:`!multiprocessing.sharedctypes` module provides functions for allocating
:mod:`ctypes` objects from shared memory which can be inherited by child
processes.
:class:`~Connection` objects returned by
:func:`~multiprocessing.Pipe`.
-However, the :mod:`multiprocessing.connection` module allows some extra
+However, the :mod:`!multiprocessing.connection` module allows some extra
flexibility. It basically gives a high level message oriented API for dealing
with sockets or Windows named pipes. It also has support for *digest
authentication* using the :mod:`hmac` module, and for polling
For a full table of logging levels, see the :mod:`logging` module.
-The :mod:`multiprocessing.dummy` module
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The :mod:`!multiprocessing.dummy` module
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. module:: multiprocessing.dummy
:synopsis: Dumb wrapper around threading.
-:mod:`multiprocessing.dummy` replicates the API of :mod:`!multiprocessing` but is
+:mod:`!multiprocessing.dummy` replicates the API of :mod:`!multiprocessing` but is
no more than a wrapper around the :mod:`threading` module.
.. currentmodule:: multiprocessing.pool
-In particular, the ``Pool`` function provided by :mod:`multiprocessing.dummy`
+In particular, the ``Pool`` function provided by :mod:`!multiprocessing.dummy`
returns an instance of :class:`ThreadPool`, which is a subclass of
:class:`Pool` that supports all the same method calls but uses a pool of
worker threads rather than worker processes.
:synopsis: pathlib types for static type checking
-The :mod:`pathlib.types` module provides types for static type checking.
+The :mod:`!pathlib.types` module provides types for static type checking.
.. versionadded:: 3.14
.. _debugger:
-:mod:`pdb` --- The Python Debugger
-==================================
+:mod:`!pdb` --- The Python Debugger
+===================================
.. module:: pdb
:synopsis: The Python debugger for interactive interpreters.
--------------
-The module :mod:`pdb` defines an interactive source code debugger for Python
+The module :mod:`!pdb` defines an interactive source code debugger for Python
programs. It supports setting (conditional) breakpoints and single stepping at
the source line level, inspection of stack frames, source code listing, and
evaluation of arbitrary Python code in the context of any stack frame. It also
.. program:: pdb
-You can also invoke :mod:`pdb` from the command line to debug other scripts. For
+You can also invoke :mod:`!pdb` from the command line to debug other scripts. For
example::
python -m pdb [-c command] (-m module | -p pid | pyfile) [args ...]
.. deprecated-removed:: 3.15 3.17
-The :mod:`profile` module is deprecated and will be removed in Python 3.17.
+The :mod:`!profile` module is deprecated and will be removed in Python 3.17.
Use :mod:`profiling.tracing` instead.
-The :mod:`profile` module provides a pure Python implementation of a
+The :mod:`!profile` module provides a pure Python implementation of a
deterministic profiler. While useful for understanding profiler internals or
extending profiler behavior through subclassing, its pure Python implementation
introduces significant overhead compared to the C-based :mod:`profiling.tracing`
Migration
=========
-Migrating from :mod:`profile` to :mod:`profiling.tracing` is straightforward.
+Migrating from :mod:`!profile` to :mod:`profiling.tracing` is straightforward.
The APIs are compatible::
# Old (deprecated)
:mod:`!profile` and :mod:`!profiling.tracing` module reference
==============================================================
-Both the :mod:`profile` and :mod:`profiling.tracing` modules provide the
+Both the :mod:`!profile` and :mod:`profiling.tracing` modules provide the
following functions:
.. function:: run(command, filename=None, sort=-1)
print(s.getvalue())
The :class:`Profile` class can also be used as a context manager (supported
- only in :mod:`profiling.tracing`, not in the deprecated :mod:`profile`
+ only in :mod:`profiling.tracing`, not in the deprecated :mod:`!profile`
module; see :ref:`typecontextmanager`)::
import profiling.tracing
Differences from :mod:`!profiling.tracing`
==========================================
-The :mod:`profile` module differs from :mod:`profiling.tracing` in several
+The :mod:`!profile` module differs from :mod:`profiling.tracing` in several
ways:
**Higher overhead.** The pure Python implementation is significantly slower
than the C implementation, making it unsuitable for profiling long-running
programs or performance-sensitive code.
-**Calibration support.** The :mod:`profile` module supports calibration to
+**Calibration support.** The :mod:`!profile` module supports calibration to
compensate for profiling overhead. This is not needed in :mod:`profiling.tracing`
because the C implementation has negligible overhead.
-**Custom timers.** Both modules support custom timers, but :mod:`profile`
+**Custom timers.** Both modules support custom timers, but :mod:`!profile`
accepts timer functions that return tuples (like :func:`os.times`), while
:mod:`profiling.tracing` requires a function returning a single number.
the accuracy of the clock (less than one clock tick), but it *can* accumulate
and become very significant.
-The problem is more important with the deprecated :mod:`profile` module than
+The problem is more important with the deprecated :mod:`!profile` module than
with the lower-overhead :mod:`profiling.tracing`. For this reason,
-:mod:`profile` provides a means of calibrating itself for a given platform so
+:mod:`!profile` provides a means of calibrating itself for a given platform so
that this error can be probabilistically (on the average) removed. After the
profiler is calibrated, it will be more accurate (in a least square sense), but
it will sometimes produce negative numbers (when call counts are exceptionally
Calibration
===========
-The profiler of the :mod:`profile` module subtracts a constant from each event
+The profiler of the :mod:`!profile` module subtracts a constant from each event
handling time to compensate for the overhead of calling the time function, and
socking away the results. By default, the constant is 0. The following
procedure can be used to obtain a better constant for a given platform (see
.. _profiling-module:
-***************************************
-:mod:`profiling` --- Python profilers
-***************************************
+**************************************
+:mod:`!profiling` --- Python profilers
+**************************************
.. module:: profiling
:synopsis: Python profiling tools for performance analysis.
fundamentally different approaches to collecting this information: statistical
sampling and deterministic tracing.
-The :mod:`profiling` package organizes Python's built-in profiling tools under
+The :mod:`!profiling` package organizes Python's built-in profiling tools under
a single namespace. It contains two submodules, each implementing a different
profiling methodology:
.. _profiling-sampling:
***************************************************
-:mod:`profiling.sampling` --- Statistical profiler
+:mod:`!profiling.sampling` --- Statistical profiler
***************************************************
.. module:: profiling.sampling
:align: center
:width: 300px
-The :mod:`profiling.sampling` module, named **Tachyon**, provides statistical
+The :mod:`!profiling.sampling` module, named **Tachyon**, provides statistical
profiling of Python programs through periodic stack sampling. Tachyon can
run scripts directly or attach to any running Python process without requiring
code changes or restarts. Because sampling occurs externally to the target
.. _profiling-tracing:
****************************************************
-:mod:`profiling.tracing` --- Deterministic profiler
+:mod:`!profiling.tracing` --- Deterministic profiler
****************************************************
.. module:: profiling.tracing
--------------
-The :mod:`profiling.tracing` module provides deterministic profiling of Python
+The :mod:`!profiling.tracing` module provides deterministic profiling of Python
programs. It monitors every function call, function return, and exception event,
recording precise timing for each. This approach provides exact call counts and
complete visibility into program execution, making it ideal for development and
.. program:: profiling.tracing
-The :mod:`profiling.tracing` module can be invoked as a script to profile
+The :mod:`!profiling.tracing` module can be invoked as a script to profile
another script or module:
.. code-block:: shell-session
error is typically less than one clock tick per call but can become
significant for functions called many times.
-The :mod:`profiling.tracing` module (and its ``cProfile`` alias) is
+The :mod:`!profiling.tracing` module (and its ``cProfile`` alias) is
implemented as a C extension with low overhead, so these timing issues are
less pronounced than with the deprecated pure Python :mod:`profile` module.
.. _pstats-module:
-********************************************
-:mod:`pstats` --- Statistics for profilers
-********************************************
+*******************************************
+:mod:`!pstats` --- Statistics for profilers
+*******************************************
.. module:: pstats
:synopsis: Statistics object for analyzing profiler output.
--------------
-The :mod:`pstats` module provides tools for reading, manipulating, and
+The :mod:`!pstats` module provides tools for reading, manipulating, and
displaying profiling statistics generated by Python's profilers. It reads
output from both :mod:`profiling.tracing` (deterministic profiler) and
:mod:`profiling.sampling` (statistical profiler).
Command-line interface
======================
-The :mod:`pstats` module can be invoked as a script to interactively browse
+The :mod:`!pstats` module can be invoked as a script to interactively browse
profile data::
python -m pstats profile_output.prof
are simply additional content model descriptions.
The values of the first two fields are constants defined in the
-:mod:`xml.parsers.expat.model` module. These constants can be collected in two
+:mod:`!xml.parsers.expat.model` module. These constants can be collected in two
groups: the model type group and the quantifier group.
The constants in the model type group are:
.. module:: xml.parsers.expat.errors
-The following constants are provided in the :mod:`xml.parsers.expat.errors`
+The following constants are provided in the :mod:`!xml.parsers.expat.errors`
module. These constants are useful in interpreting some of the attributes of
the :exc:`ExpatError` exception objects raised when an error has occurred.
Since for backwards compatibility reasons, the constants' value is the error
alphabetically before :file:`foo.pth`; and :file:`spam` is omitted because it is
not mentioned in either path configuration file.
-:mod:`sitecustomize`
---------------------
+:mod:`!sitecustomize`
+---------------------
.. module:: sitecustomize
After these path manipulations, an attempt is made to import a module named
-:mod:`sitecustomize`, which can perform arbitrary site-specific customizations.
+:mod:`!sitecustomize`, which can perform arbitrary site-specific customizations.
It is typically created by a system administrator in the site-packages
directory. If this import fails with an :exc:`ImportError` or its subclass
exception, and the exception's :attr:`~ImportError.name`
attribute equals to ``'sitecustomize'``,
it is silently ignored. If Python is started without output streams available, as
with :file:`pythonw.exe` on Windows (which is used by default to start IDLE),
-attempted output from :mod:`sitecustomize` is ignored. Any other exception
+attempted output from :mod:`!sitecustomize` is ignored. Any other exception
causes a silent and perhaps mysterious failure of the process.
-:mod:`usercustomize`
---------------------
+:mod:`!usercustomize`
+---------------------
.. module:: usercustomize
-After this, an attempt is made to import a module named :mod:`usercustomize`,
+After this, an attempt is made to import a module named :mod:`!usercustomize`,
which can perform arbitrary user-specific customizations, if
:data:`~site.ENABLE_USER_SITE` is true. This file is intended to be created in the
user site-packages directory (see below), which is part of ``sys.path`` unless
Note that for some non-Unix systems, ``sys.prefix`` and ``sys.exec_prefix`` are
empty, and the path manipulations are skipped; however the import of
-:mod:`sitecustomize` and :mod:`usercustomize` is still attempted.
+:mod:`sitecustomize` and :mod:`!usercustomize` is still attempted.
.. currentmodule:: site
The :mod:`!test` package can be run as a script to drive Python's regression
test suite, thanks to the :option:`-m` option: :program:`python -m test`. Under
-the hood, it uses :mod:`test.regrtest`; the call :program:`python -m
+the hood, it uses :mod:`!test.regrtest`; the call :program:`python -m
test.regrtest` used in previous Python versions still works. Running the
script by itself automatically starts running all regression tests in the
:mod:`!test` package. It does this by finding all modules in the package whose
:ref:`controlled using environment variables <using-on-controlling-color>`.
-:mod:`test.support` --- Utilities for the Python test suite
-===========================================================
+:mod:`!test.support` --- Utilities for the Python test suite
+============================================================
.. module:: test.support
:synopsis: Support for Python's regression test suite.
-The :mod:`test.support` module provides support for Python's regression
+The :mod:`!test.support` module provides support for Python's regression
test suite.
.. note::
- :mod:`test.support` is not a public module. It is documented here to help
+ :mod:`!test.support` is not a public module. It is documented here to help
Python developers write tests. The API of this module is subject to change
without backwards compatibility concerns between releases.
function.
-The :mod:`test.support` module defines the following constants:
+The :mod:`!test.support` module defines the following constants:
.. data:: verbose
.. data:: TEST_SUPPORT_DIR
- Set to the top level directory that contains :mod:`test.support`.
+ Set to the top level directory that contains :mod:`!test.support`.
.. data:: TEST_HOME_DIR
Used to test mixed type comparison.
-The :mod:`test.support` module defines the following functions:
+The :mod:`!test.support` module defines the following functions:
.. function:: busy_retry(timeout, err_msg=None, /, *, error=True)
.. versionadded:: 3.11
-The :mod:`test.support` module defines the following classes:
+The :mod:`!test.support` module defines the following classes:
.. class:: SuppressCrashReport()
Try to match a single stored value (*dv*) with a supplied value (*v*).
-:mod:`test.support.socket_helper` --- Utilities for socket tests
-================================================================
+:mod:`!test.support.socket_helper` --- Utilities for socket tests
+=================================================================
.. module:: test.support.socket_helper
:synopsis: Support for socket tests.
-The :mod:`test.support.socket_helper` module provides support for socket tests.
+The :mod:`!test.support.socket_helper` module provides support for socket tests.
.. versionadded:: 3.9
exceptions.
-:mod:`test.support.script_helper` --- Utilities for the Python execution tests
-==============================================================================
+:mod:`!test.support.script_helper` --- Utilities for the Python execution tests
+===============================================================================
.. module:: test.support.script_helper
:synopsis: Support for Python's script execution tests.
-The :mod:`test.support.script_helper` module provides support for Python's
+The :mod:`!test.support.script_helper` module provides support for Python's
script execution tests.
.. function:: interpreter_requires_environment()
path and the archive name for the zip file.
-:mod:`test.support.bytecode_helper` --- Support tools for testing correct bytecode generation
-=============================================================================================
+:mod:`!test.support.bytecode_helper` --- Support tools for testing correct bytecode generation
+==============================================================================================
.. module:: test.support.bytecode_helper
:synopsis: Support tools for testing correct bytecode generation.
-The :mod:`test.support.bytecode_helper` module provides support for testing
+The :mod:`!test.support.bytecode_helper` module provides support for testing
and inspecting bytecode generation.
.. versionadded:: 3.9
Throws :exc:`AssertionError` if *opname* is found.
-:mod:`test.support.threading_helper` --- Utilities for threading tests
-======================================================================
+:mod:`!test.support.threading_helper` --- Utilities for threading tests
+=======================================================================
.. module:: test.support.threading_helper
:synopsis: Support for threading tests.
-The :mod:`test.support.threading_helper` module provides support for threading tests.
+The :mod:`!test.support.threading_helper` module provides support for threading tests.
.. versionadded:: 3.10
finished.
-:mod:`test.support.os_helper` --- Utilities for os tests
-========================================================================
+:mod:`!test.support.os_helper` --- Utilities for os tests
+=========================================================
.. module:: test.support.os_helper
:synopsis: Support for os tests.
-The :mod:`test.support.os_helper` module provides support for os tests.
+The :mod:`!test.support.os_helper` module provides support for os tests.
.. versionadded:: 3.10
wrapped with a wait loop that checks for the existence of the file.
-:mod:`test.support.import_helper` --- Utilities for import tests
-================================================================
+:mod:`!test.support.import_helper` --- Utilities for import tests
+=================================================================
.. module:: test.support.import_helper
:synopsis: Support for import tests.
-The :mod:`test.support.import_helper` module provides support for import tests.
+The :mod:`!test.support.import_helper` module provides support for import tests.
.. versionadded:: 3.10
will be reverted at the end of the block.
-:mod:`test.support.warnings_helper` --- Utilities for warnings tests
-====================================================================
+:mod:`!test.support.warnings_helper` --- Utilities for warnings tests
+=====================================================================
.. module:: test.support.warnings_helper
:synopsis: Support for warnings tests.
-The :mod:`test.support.warnings_helper` module provides support for warnings tests.
+The :mod:`!test.support.warnings_helper` module provides support for warnings tests.
.. versionadded:: 3.10
Set turtle mode ("standard", "logo" or "world") and perform reset. If mode
is not given, current mode is returned.
- Mode "standard" is compatible with old :mod:`turtle`. Mode "logo" is
+ Mode "standard" is compatible with old :mod:`!turtle`. Mode "logo" is
compatible with most Logo turtle graphics. Mode "world" uses user-defined
"world coordinates". **Attention**: in this mode angles appear distorted if
``x/y`` unit-ratio doesn't equal 1.
Python script :file:`{filename}.py`. It is intended to serve as a template
for translation of the docstrings into different languages.
-If you (or your students) want to use :mod:`turtle` with online help in your
+If you (or your students) want to use :mod:`!turtle` with online help in your
native language, you have to translate the docstrings and save the resulting
file as e.g. :file:`turtle_docstringdict_german.py`.
auto``.
- If you set e.g. ``language = italian`` the docstringdict
:file:`turtle_docstringdict_italian.py` will be loaded at import time (if
- present on the import path, e.g. in the same directory as :mod:`turtle`).
+ present on the import path, e.g. in the same directory as :mod:`!turtle`).
- The entries *exampleturtle* and *examplescreen* define the names of these
objects as they occur in the docstrings. The transformation of
method-docstrings to function-docstrings will delete these names from the
switch ("no subprocess"). This will prevent :func:`exitonclick` to enter the
mainloop.
-There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` is
+There can be a :file:`turtle.cfg` file in the directory where :mod:`!turtle` is
stored and an additional one in the current working directory. The latter will
override the settings of the first one.
not from within the demo-viewer).
-:mod:`turtledemo` --- Demo scripts
-==================================
+:mod:`!turtledemo` --- Demo scripts
+===================================
.. module:: turtledemo
:synopsis: A viewer for example turtle scripts
-The :mod:`turtledemo` package includes a set of demo scripts. These
+The :mod:`!turtledemo` package includes a set of demo scripts. These
scripts can be run and viewed using the supplied demo viewer as follows::
python -m turtledemo
python -m turtledemo.bytedesign
-The :mod:`turtledemo` package directory contains:
+The :mod:`!turtledemo` package directory contains:
- A demo viewer :file:`__main__.py` which can be used to view the sourcecode
of the scripts and run them at the same time.
-- Multiple scripts demonstrating different features of the :mod:`turtle`
+- Multiple scripts demonstrating different features of the :mod:`!turtle`
module. Examples can be accessed via the Examples menu. They can also
be run standalone.
- A :file:`turtle.cfg` file which serves as an example of how to write
-:mod:`urllib.response` --- Response classes used by urllib
-==========================================================
+:mod:`!urllib.response` --- Response classes used by urllib
+===========================================================
.. module:: urllib.response
:synopsis: Response classes used by urllib.
-The :mod:`urllib.response` module defines functions and classes which define a
+The :mod:`!urllib.response` module defines functions and classes which define a
minimal file-like interface, including ``read()`` and ``readline()``.
Functions defined by this module are used internally by the :mod:`!urllib.request` module.
The typical response object is a :class:`urllib.response.addinfourl` instance:
.. _mod-weakref:
-:mod:`weakref` --- Weak references
-==================================
+:mod:`!weakref` --- Weak references
+===================================
.. module:: weakref
:synopsis: Support for weak references and weak dictionaries.
--------------
-The :mod:`weakref` module allows the Python programmer to create :dfn:`weak
+The :mod:`!weakref` module allows the Python programmer to create :dfn:`weak
references` to objects.
.. When making changes to the examples in this file, be sure to update
images, or images to names, the image objects would remain alive just because
they appeared as values or keys in the dictionaries. The
:class:`WeakKeyDictionary` and :class:`WeakValueDictionary` classes supplied by
-the :mod:`weakref` module are an alternative, using weak references to construct
+the :mod:`!weakref` module are an alternative, using weak references to construct
mappings that don't keep objects alive solely because they appear in the mapping
objects. If, for example, an image object is a value in a
:class:`WeakValueDictionary`, then when the last remaining references to that
Most programs should find that using one of these weak container types
or :class:`finalize` is all they need -- it's not usually necessary to
create your own weak references directly. The low-level machinery is
-exposed by the :mod:`weakref` module for the benefit of advanced uses.
+exposed by the :mod:`!weakref` module for the benefit of advanced uses.
Not all objects can be weakly referenced. Objects which support weak references
include class instances, functions written in Python (but not in C), instance methods,
.. warning::
- :mod:`wsgiref` is a reference implementation and is not recommended for
+ :mod:`!wsgiref` is a reference implementation and is not recommended for
production. The module only implements basic security checks.
The Web Server Gateway Interface (WSGI) is a standard interface between web
.. XXX If you're just trying to write a web application...
-:mod:`wsgiref.util` -- WSGI environment utilities
--------------------------------------------------
+:mod:`!wsgiref.util` -- WSGI environment utilities
+--------------------------------------------------
.. module:: wsgiref.util
:synopsis: WSGI environment utilities.
httpd.serve_forever()
-In addition to the environment functions above, the :mod:`wsgiref.util` module
+In addition to the environment functions above, the :mod:`!wsgiref.util` module
also provides these miscellaneous utilities:
Support for :meth:`~object.__getitem__` method has been removed.
-:mod:`wsgiref.headers` -- WSGI response header tools
-----------------------------------------------------
+:mod:`!wsgiref.headers` -- WSGI response header tools
+-----------------------------------------------------
.. module:: wsgiref.headers
:synopsis: WSGI response header tools.
*headers* parameter is optional.
-:mod:`wsgiref.simple_server` -- a simple WSGI HTTP server
----------------------------------------------------------
+:mod:`!wsgiref.simple_server` -- a simple WSGI HTTP server
+----------------------------------------------------------
.. module:: wsgiref.simple_server
:synopsis: A simple WSGI HTTP server.
This function is a small but complete WSGI application that returns a text page
containing the message "Hello world!" and a list of the key/value pairs provided
in the *environ* parameter. It's useful for verifying that a WSGI server (such
- as :mod:`wsgiref.simple_server`) is able to run a simple WSGI application
+ as :mod:`!wsgiref.simple_server`) is able to run a simple WSGI application
correctly.
The *start_response* callable should follow the :class:`.StartResponse` protocol.
interface.
-:mod:`wsgiref.validate` --- WSGI conformance checker
-----------------------------------------------------
+:mod:`!wsgiref.validate` --- WSGI conformance checker
+-----------------------------------------------------
.. module:: wsgiref.validate
:synopsis: WSGI conformance checker.
When creating new WSGI application objects, frameworks, servers, or middleware,
it can be useful to validate the new code's conformance using
-:mod:`wsgiref.validate`. This module provides a function that creates WSGI
+:mod:`!wsgiref.validate`. This module provides a function that creates WSGI
application objects that validate communications between a WSGI server or
gateway and a WSGI application object, to check both sides for protocol
conformance.
httpd.serve_forever()
-:mod:`wsgiref.handlers` -- server/gateway base classes
-------------------------------------------------------
+:mod:`!wsgiref.handlers` -- server/gateway base classes
+-------------------------------------------------------
.. module:: wsgiref.handlers
:synopsis: WSGI server/gateway base classes.
The default environment variables to be included in every request's WSGI
environment. By default, this is a copy of ``os.environ`` at the time that
- :mod:`wsgiref.handlers` was imported, but subclasses can either create their own
+ :mod:`!wsgiref.handlers` was imported, but subclasses can either create their own
at the class or instance level. Note that the dictionary should be considered
read-only, since the default value is shared between multiple classes and
instances.
.. versionadded:: 3.2
-:mod:`wsgiref.types` -- WSGI types for static type checking
------------------------------------------------------------
+:mod:`!wsgiref.types` -- WSGI types for static type checking
+------------------------------------------------------------
.. module:: wsgiref.types
:synopsis: WSGI types for static type checking
If you need to parse untrusted or unauthenticated data, see
:ref:`xml-security`.
-It is important to note that modules in the :mod:`xml` package require that
+It is important to note that modules in the :mod:`!xml` package require that
there be at least one SAX-compliant XML parser available. The Expat parser is
included with Python, so the :mod:`xml.parsers.expat` module will always be
available.