=============
ABC-Backports
=============
Usage:
.. code-block:: python
try:
# ABCs live in "collections.abc" in Python >= 3.3
from collections.abc import Coroutine, Generator
except ImportError:
# fall back to import from "backports_abc"
from backports_abc import Coroutine, Generator
You can also install the ABCs into the stdlib by calling the ``patch()``
function:
.. code-block:: python
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 backports_abc import Coroutine, Generator
Currently, ``patch()`` provides the following names if missing:
* ``collections.abc.Generator``
* ``collections.abc.Awaitable``
* ``collections.abc.Coroutine``
* ``inspect.isawaitable(obj)``
All of them are also available directly from the ``backports_abc``
module namespace.
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 importing this module will not be overwritten.
The names that were previously patched by ``patch()`` can be queried
through the mapping in ``backports_abc.PATCHED``.
Changelog
=========
0.5 (2016-11-12)
----------------
* support old-style (mro-missing) classes
0.4 (2015-09-14)
----------------
* direct wheel building support
* make all names available at the module level instead of requiring patching
0.3 (2015-07-03)
----------------
* removed patching of ``inspect.iscoroutine()`` as it is not ABC based
0.2 (2015-07-03)
----------------
* 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()
0.1 (2015-06-24)
----------------
* initial public release
* provided ABCs: Generator, Coroutine, Awaitable
Raw data
{
"_id": null,
"home_page": "https://github.com/cython/backports_abc",
"name": "backports_abc",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Stefan Behnel et al.",
"author_email": "cython-devel@python.org",
"download_url": "https://files.pythonhosted.org/packages/68/3c/1317a9113c377d1e33711ca8de1e80afbaf4a3c950dd0edfaf61f9bfe6d8/backports_abc-0.5.tar.gz",
"platform": "UNKNOWN",
"description": "=============\nABC-Backports\n=============\n\nUsage:\n\n.. code-block:: python\n\n try:\n # ABCs live in \"collections.abc\" in Python >= 3.3\n from collections.abc import Coroutine, Generator\n except ImportError:\n # fall back to import from \"backports_abc\"\n from backports_abc import Coroutine, Generator\n\nYou can also install the ABCs into the stdlib by calling the ``patch()``\nfunction:\n\n.. code-block:: python\n\n import backports_abc\n backports_abc.patch()\n\n try:\n # ABCs live in \"collections.abc\" in Python >= 3.3\n from collections.abc import Coroutine, Generator\n except ImportError:\n # fall back to import from \"collections\" in Python <= 3.2\n from backports_abc import Coroutine, Generator\n\nCurrently, ``patch()`` provides the following names if missing:\n\n* ``collections.abc.Generator``\n* ``collections.abc.Awaitable``\n* ``collections.abc.Coroutine``\n* ``inspect.isawaitable(obj)``\n\nAll of them are also available directly from the ``backports_abc``\nmodule namespace.\n\nIn Python 2.x and Python 3.2, it patches the ``collections`` module\ninstead of the ``collections.abc`` module. Any names that are already\navailable when importing this module will not be overwritten.\n\nThe names that were previously patched by ``patch()`` can be queried\nthrough the mapping in ``backports_abc.PATCHED``.\n\nChangelog\n=========\n\n0.5 (2016-11-12)\n----------------\n\n* support old-style (mro-missing) classes\n\n0.4 (2015-09-14)\n----------------\n\n* direct wheel building support\n\n* make all names available at the module level instead of requiring patching\n\n\n0.3 (2015-07-03)\n----------------\n\n* removed patching of ``inspect.iscoroutine()`` as it is not ABC based\n\n\n0.2 (2015-07-03)\n----------------\n\n* require explicit ``backports_abc.patch()`` call to do the patching\n (avoids side-effects on import and allows future configuration)\n\n* provide access to patched names through global ``PATCHED`` dict\n\n* add ABC based implementations of inspect.iscoroutine() and\n inspect.isawaitable()\n\n\n0.1 (2015-06-24)\n----------------\n\n* initial public release\n\n* provided ABCs: Generator, Coroutine, Awaitable",
"bugtrack_url": null,
"license": "UNKNOWN",
"summary": "A backport of recent additions to the 'collections.abc' module.",
"version": "0.5",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7d566f3ac1b816d0cd8994e83d0c4e55bc64567532f7dc543378bd87f81cebc7",
"md5": "8a2af5176b751b185b8cb2241e0f40fc",
"sha256": "52089f97fe7a9aa0d3277b220c1d730a85aefd64e1b2664696fe35317c5470a7"
},
"downloads": -1,
"filename": "backports_abc-0.5-py2.py3-none-any.whl",
"has_sig": true,
"md5_digest": "8a2af5176b751b185b8cb2241e0f40fc",
"packagetype": "bdist_wheel",
"python_version": "3.5",
"requires_python": null,
"size": 5232,
"upload_time": "2016-11-12T16:05:34",
"upload_time_iso_8601": "2016-11-12T16:05:34.577002Z",
"url": "https://files.pythonhosted.org/packages/7d/56/6f3ac1b816d0cd8994e83d0c4e55bc64567532f7dc543378bd87f81cebc7/backports_abc-0.5-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "683c1317a9113c377d1e33711ca8de1e80afbaf4a3c950dd0edfaf61f9bfe6d8",
"md5": "7d1936ec183a3586290adf60f6f96764",
"sha256": "033be54514a03e255df75c5aee8f9e672f663f93abb723444caec8fe43437bde"
},
"downloads": -1,
"filename": "backports_abc-0.5.tar.gz",
"has_sig": true,
"md5_digest": "7d1936ec183a3586290adf60f6f96764",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9807,
"upload_time": "2016-11-12T16:05:31",
"upload_time_iso_8601": "2016-11-12T16:05:31.962976Z",
"url": "https://files.pythonhosted.org/packages/68/3c/1317a9113c377d1e33711ca8de1e80afbaf4a3c950dd0edfaf61f9bfe6d8/backports_abc-0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2016-11-12 16:05:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "cython",
"github_project": "backports_abc",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "backports_abc"
}