Top level

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.VersionInfo representing 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 frozenset of 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 config from this set.

Changed in version 0.9.0: Added cli to this set.

Changed in version 0.8.28: Added context to this set.

asyncutils.preloaded_submodules frozenset[str]

A frozenset of names of submodules which are preloaded when importing the library for essential initialization.

Changed in version 0.9.3: Removed config from this set.

Changed in version 0.9.0: Added cli to this set.

Changed in version 0.8.28: Added context to this set.

asyncutils.submodules_map dict[str, types.ModuleType]

A dict mapping 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 of types.ModuleType and provides a load() method that fetches the submodule and replaces the entry in both submodules_map and sys.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 a float. 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 asyncutils without 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.