compose-stubs
=============
`Type stubs <https://peps.python.org/pep-0561/#stub-only-packages>`_
for |compose|_.
.. |compose| replace:: ``compose``
.. _compose: https://pypi.org/project/compose
Versioning
----------
This library's version numbers follow the `SemVer 2.0.0
specification <https://semver.org/spec/v2.0.0.html>`_.
Installation
------------
::
pip install compose-stubs
Usage
-----
Like any other typing stub package, once installed it should
"just work". You might need to restart your type checker.
Limitations
-----------
1. MyPy fails to match the return type of an ``async``
function to the argument type of the next function
in the type hints of ``acompose`` and ``sacompose``,
leading to false errors about types not matching.
(Pyright and Pyre don't have this problem.)
2. Due to limitations in Python type hints, these typing stubs
only cover at most 16 arguments in a single call to ``compose``,
``acompose``, or ``sacompose``. This limit could be higher,
but the higher the limit, the slower the type-checking.
A simple workaround is to just use multiple compose calls
to build up compositions bigger than 16 functions.
3. Due to limitations in Python type hints, there is an edge
case in the type hints for ``sacompose`` if the return type
of one function in a composition is awaitable and the next
function accepts that awaitable (the most likely way for
this to happen is if it accepts ``Any``), then ``sacompose``
actually returns an async callable, but the type inference
will think that it returns a sync callable.
4. Requires Python 3.10 and above (``compose`` itself remains
supported on much older versions, but the type hints need
``typing.ParamSpec``).
Raw data
{
"_id": null,
"home_page": "https://github.com/mentalisttraceur/python-compose-stubs",
"name": "compose-stubs",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Alexander Kozhevnikov",
"author_email": "mentalisttraceur@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8c/49/50608111b98f0430af99294bef2fc9ddbb9c06e50363d803eeef3b5ae285/compose-stubs-1.0.0.tar.gz",
"platform": null,
"description": "compose-stubs\n=============\n\n`Type stubs <https://peps.python.org/pep-0561/#stub-only-packages>`_\nfor |compose|_.\n\n.. |compose| replace:: ``compose``\n.. _compose: https://pypi.org/project/compose\n\n\nVersioning\n----------\n\nThis library's version numbers follow the `SemVer 2.0.0\nspecification <https://semver.org/spec/v2.0.0.html>`_.\n\n\nInstallation\n------------\n\n::\n\n pip install compose-stubs\n\n \nUsage\n-----\n\nLike any other typing stub package, once installed it should\n\"just work\". You might need to restart your type checker.\n\n\nLimitations\n-----------\n\n1. MyPy fails to match the return type of an ``async``\n function to the argument type of the next function\n in the type hints of ``acompose`` and ``sacompose``,\n leading to false errors about types not matching.\n (Pyright and Pyre don't have this problem.)\n\n2. Due to limitations in Python type hints, these typing stubs\n only cover at most 16 arguments in a single call to ``compose``,\n ``acompose``, or ``sacompose``. This limit could be higher,\n but the higher the limit, the slower the type-checking.\n A simple workaround is to just use multiple compose calls\n to build up compositions bigger than 16 functions.\n\n3. Due to limitations in Python type hints, there is an edge\n case in the type hints for ``sacompose`` if the return type\n of one function in a composition is awaitable and the next\n function accepts that awaitable (the most likely way for\n this to happen is if it accepts ``Any``), then ``sacompose``\n actually returns an async callable, but the type inference\n will think that it returns a sync callable.\n\n4. Requires Python 3.10 and above (``compose`` itself remains\n supported on much older versions, but the type hints need\n ``typing.ParamSpec``).\n",
"bugtrack_url": null,
"license": "0BSD",
"summary": "Type stubs for compose",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/mentalisttraceur/python-compose-stubs"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d38ba8311e0b948be3b237af0860aa93db92f180a8e60edff16a6542db65fb09",
"md5": "2513bff4a3f24c22b6e08688a11f3f92",
"sha256": "591c60b0d806e4bdce241854e67deb8c58cdea9caae018ef21747bc487822308"
},
"downloads": -1,
"filename": "compose_stubs-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2513bff4a3f24c22b6e08688a11f3f92",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3777,
"upload_time": "2023-08-18T16:13:03",
"upload_time_iso_8601": "2023-08-18T16:13:03.876998Z",
"url": "https://files.pythonhosted.org/packages/d3/8b/a8311e0b948be3b237af0860aa93db92f180a8e60edff16a6542db65fb09/compose_stubs-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8c4950608111b98f0430af99294bef2fc9ddbb9c06e50363d803eeef3b5ae285",
"md5": "acca0797c8cb603d8ece198399b0f94a",
"sha256": "aff4ac0f5f393a6ccb297c1cb375ee00bd6b26b5836ccae64d840d2952110ea3"
},
"downloads": -1,
"filename": "compose-stubs-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "acca0797c8cb603d8ece198399b0f94a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3855,
"upload_time": "2023-08-18T16:13:05",
"upload_time_iso_8601": "2023-08-18T16:13:05.128843Z",
"url": "https://files.pythonhosted.org/packages/8c/49/50608111b98f0430af99294bef2fc9ddbb9c06e50363d803eeef3b5ae285/compose-stubs-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-18 16:13:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mentalisttraceur",
"github_project": "python-compose-stubs",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "compose-stubs"
}