Hints your function with an existing one.
Project description
hintwith
Hints your function with an existing one.
Installation
$ pip install hintwith
Usage
Use hintwith()
to hint a function with another one:
>>> 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
PyPI project
License
This project falls under the BSD 3-Clause License.
History
v0.1.1
- New optional parameter for
hintwith()
andhintwithmethod()
:__is_method
: determines whether the decorated function is a method.
v0.1.0
- Initial release.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for hintwith-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b5c81d0943140737a0d4b926c171b4d541090dd62a89ef61a606e0454e67a3b |
|
MD5 | 6ddd6f86d2cb785588b0f896c176433c |
|
BLAKE2b-256 | 46cef931130ee75ae144e9c1a54c683fece46c0d7257eaa7b6dc30d14cb5e2a9 |