Top level#
This section documents the symbols defined at the top level of this package.
- asyncutils.__version__ asyncutils.version.VersionInfo
An instance of
asyncutils.version.VersionInforepresenting the current pip/conda version of this library.- Note:
This library adheres to Semantic Versioning 2.0.0.
- asyncutils.__hexversion__ int
An integer representing the current pip/conda version of this library. Comparison operators behave as expected. For version 1.3.11, for instance, this would be
0x01030b.- Note:
Equivalent to
int(__version__)
- asyncutils.console_preloaded_submodules frozenset[str]
A
frozensetof submodule names which are loaded when starting the interactive console of this module.- Note:
It is a strict superset of
preloaded_submodules.
Changed in version 0.9.3: Removed
configfrom this set.Changed in version 0.9.0: Added
clito this set.Changed in version 0.8.28: Added
contextto this set.
- asyncutils.preloaded_submodules frozenset[str]
A
frozensetof names of submodules which are preloaded when importing the library for essential initialization.Changed in version 0.9.3: Removed
configfrom this set.Changed in version 0.9.0: Added
clito this set.Changed in version 0.8.28: Added
contextto this set.
- asyncutils.submodules_map dict[str, types.ModuleType]
A
dictmapping submodule names to the corresponding submodule objects.- Tip:
For submodules that are already loaded, these are exact instances of
types.ModuleType.- Note:
For submodules that are not yet loaded, the value is an instance of an internal class with the same behaviour but not inserted into
sys.modules. This class is not a subclass oftypes.ModuleTypeand provides aload()method that fetches the submodule and replaces the entry in bothsubmodules_mapandsys.modules, and returns the real submodule object. For attribute accesses, it acts as a proxy to the real submodule, loading it when strictly required; however, when modifying or deleting attributes, the submodule is gotten unconditionally and replaces the proxy.- Admonition:
Implementation detail
The exact deferment mechanism is not part of the public API.
- asyncutils.time_since_boot() float[source]
Time since the module was imported or invoked in the command line in milliseconds, as returned by
time.monotonic(), as afloat. Useful for benchmarking the module’s performance.
The remarks below are inapplicable to the contextually configured constants in context:
One can directly access members of submodules as attributes of the main module, which will dispatch to the appropriate submodule.
The submodule objects are also accessible as attributes of
asyncutilswithout triggering the loading immediately if not loaded.Each module has an
__all__attribute, a tuple of strings representing its public API.Except
__version__and__hexversion__, anything not included in__all__is considered unstable or private.