Skip to main content

hintwith

Hints your function with an existing one.

Installation

$ pip install hintwith

Usage

Use hintwith() to hint a function with another function:

>>> 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.5

  • New optional parameter for hintwith() and hintwithmethod():
    • use_doc: determines whether to use the docstring of the original function.

v0.1.4

  • New optional parameter for hintwith() and hintwithmethod():
    • __hint_returntype : determines whether to use the return type of the original function.

v0.1.0

  • Initial release.

Metadata

Release files for hintwith 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for hintwith 0.1.5
File Interpreter ABI Platform
hintwith-0.1.5-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / hintwith-0.1.5-py2.py3-none-any.whl

Download URL hintwith-0.1.5-py2.py3-none-any.whl
Size 4.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
7d7c20cad64b6d8c3804faf6bb8befb54f88e27f3724171f453e454fd5f22f0a
BLAKE2b-256 checksum
How to use checksums
383e959cc09213388b1871dcc5ee6d1ca403baa2b65a0340ca4f49cc2fb5948b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.13

Release history Release notifications | RSS feed

This release

0.1.5 This release

1 release file

0.1.4

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page