A backport of recent additions to the 'collections.abc' module.
import backports_abc backports_abc.patch() try: # ABCs live in "collections.abc" in Python >= 3.3 from collections.abc import Coroutine, Generator except ImportError: # fall back to import from "collections" in Python <= 3.2 from collections import Coroutine, Generator
Currently provides the following names if missing:
In Python 2.x and Python 3.2, it patches the collections module instead of the collections.abc module. Any names that are already available when calling patch() will not be overwritten.
The names that were previously patched by patch() can be queried through the mapping in backports_abc.PATCHED.
- removed patching of inspect.iscoroutine() as it is not ABC based
- require explicit backports_abc.patch() call to do the patching (avoids side-effects on import and allows future configuration)
- provide access to patched names through global PATCHED dict
- add ABC based implementations of inspect.iscoroutine() and inspect.isawaitable()
- initial public release
- provided ABCs: Generator, Coroutine, Awaitable
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size backports_abc-0.3.tar.gz (4.8 kB)||File type Source||Python version None||Upload date||Hashes View hashes|