Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dispatch_generic-0.4.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dispatch_generic-0.4.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

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

Hashes for dispatch_generic-0.4.2.tar.gz
Algorithm Hash digest
SHA256 7482300c67a184c9ed835bf752d62818ba8a011dee7e2318e76ef51947b6418b
MD5 2e1322d8907ccfa55dcbbdaebc7a4e43
BLAKE2b-256 7fa7cc5fbecd107333625cce59524c03ae4dc58aff65ce6f686c80e272edef33

See more details on using hashes here.

File details

Details for the file dispatch_generic-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for dispatch_generic-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 329ae8fa0926e8a2b17a893985686b081295ec7a525716d05384a76eba799038
MD5 8ce820fda07d2144f73e497ed4eefda2
BLAKE2b-256 28d4b3e34c4b26c925f942c207cf2d3b95435d5e220802a7af2e1495d8ae5e19

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page