A simple dispatch decorator for generic functions
Project description
dispatch-generic
A simple dispatch decorator for generic functions.
pip install dispatch
from dispatch import dispatch
@dispatch
def test(i: int):
print('for int')
@dispatch
def test(s: str):
print('for str')
test(5) # for int
test('s') # for str
test() # TypeError
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dispatch_generic-0.4.2.tar.gz.
File metadata
- Download URL: dispatch_generic-0.4.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.14.0a5+
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7482300c67a184c9ed835bf752d62818ba8a011dee7e2318e76ef51947b6418b
|
|
| MD5 |
2e1322d8907ccfa55dcbbdaebc7a4e43
|
|
| BLAKE2b-256 |
7fa7cc5fbecd107333625cce59524c03ae4dc58aff65ce6f686c80e272edef33
|
File details
Details for the file dispatch_generic-0.4.2-py3-none-any.whl.
File metadata
- Download URL: dispatch_generic-0.4.2-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.14.0a5+
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
329ae8fa0926e8a2b17a893985686b081295ec7a525716d05384a76eba799038
|
|
| MD5 |
8ce820fda07d2144f73e497ed4eefda2
|
|
| BLAKE2b-256 |
28d4b3e34c4b26c925f942c207cf2d3b95435d5e220802a7af2e1495d8ae5e19
|