# hintwith
Hints your function with an existing one.
## Installation
```sh
$ pip install hintwith
```
## Usage
Use `hintwith()` to hint a function with another function:
```py
>>> from hintwith import hintwith
>>> def a(x: int, y: int, z: int = 0) -> int:
... """Sums x, y and z."""
... return x + y + z
...
>>> @hintwith(a)
... def b(*args, **kwargs) -> float:
... return float(a(*args, **kwargs))
...
```
Also, there is `hintwithmethod()` to hint the function with a method rather than a direct callable.
## See Also
### Github repository
* https://github.com/Chitaoji/hintwith/
### PyPI project
* https://pypi.org/project/hintwith/
## License
This project falls under the BSD 3-Clause License.
## History
### v0.1.4
* Renamed the positional argument `__is_method=` to `__hint_returntype=` for the avoidance of ambiguity.
### v0.1.3
* Removed the positional argument `__is_method=` from `hintwith()` and `hintwithmethod()`; added a new positional argument `__hint_returns=` to them.
### v0.1.2
* Updated comments.
### v0.1.1
* New optional parameter for `hintwith()` and `hintwithmethod()`:
* `__is_method` : determines whether the function to get hinted is a method.
### v0.1.0
* Initial release.
Raw data
{
"_id": null,
"home_page": "https://github.com/Chitaoji/hintwith/",
"name": "hintwith",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8.13",
"maintainer_email": null,
"keywords": null,
"author": "Chitaoji",
"author_email": "2360742040@qq.com",
"download_url": null,
"platform": null,
"description": "\n# hintwith\nHints your function with an existing one.\n\n## Installation\n\n```sh\n$ pip install hintwith\n```\n\n## Usage\n\nUse `hintwith()` to hint a function with another function:\n\n```py\n>>> from hintwith import hintwith\n>>> def a(x: int, y: int, z: int = 0) -> int:\n... \"\"\"Sums x, y and z.\"\"\"\n... return x + y + z\n... \n>>> @hintwith(a)\n... def b(*args, **kwargs) -> float:\n... return float(a(*args, **kwargs))\n... \n```\n\nAlso, there is `hintwithmethod()` to hint the function with a method rather than a direct callable.\n\n## See Also\n### Github repository\n* https://github.com/Chitaoji/hintwith/\n\n### PyPI project\n* https://pypi.org/project/hintwith/\n\n## License\nThis project falls under the BSD 3-Clause License.\n\n## History\n### v0.1.4\n* Renamed the positional argument `__is_method=` to `__hint_returntype=` for the avoidance of ambiguity.\n\n### v0.1.3\n* Removed the positional argument `__is_method=` from `hintwith()` and `hintwithmethod()`; added a new positional argument `__hint_returns=` to them.\n\n### v0.1.2\n* Updated comments.\n\n### v0.1.1\n* New optional parameter for `hintwith()` and `hintwithmethod()`:\n * `__is_method` : determines whether the function to get hinted is a method.\n\n### v0.1.0\n* Initial release.\n\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Hints your function with an existing one.",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://github.com/Chitaoji/hintwith/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ccab21a39adc76ee95d71a410f071ad2759d466d4971f98ff4535bb422f6a052",
"md5": "ca963c4cd0bdc1799b42959ff81c14e7",
"sha256": "72e69dc10582c2845e544adba7638dc4f796d2d6a29cdc57608c1748d40bafbb"
},
"downloads": -1,
"filename": "hintwith-0.1.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "ca963c4cd0bdc1799b42959ff81c14e7",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.8.13",
"size": 4450,
"upload_time": "2024-10-08T08:18:16",
"upload_time_iso_8601": "2024-10-08T08:18:16.637102Z",
"url": "https://files.pythonhosted.org/packages/cc/ab/21a39adc76ee95d71a410f071ad2759d466d4971f98ff4535bb422f6a052/hintwith-0.1.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-08 08:18:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Chitaoji",
"github_project": "hintwith",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hintwith"
}