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-generic

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-1.0.1.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-1.0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file dispatch_generic-1.0.1.tar.gz.

File metadata

  • Download URL: dispatch_generic-1.0.1.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-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b9c934d02283e23243f95a83605611be0cff840b15a52b457ef9f3cf1dd5d912
MD5 111c9aac78400ea5f400a325a71db458
BLAKE2b-256 e13ac52daa30f7b4d2e82ee90cdabed3144271ed4a73e33e2dd3eba712624c17

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dispatch_generic-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f21521be13f0f0900f52000e48314b70a177d24886d92188d7772be122d97cdf
MD5 c6bdcabe509dd5d653dad3d4989e50a7
BLAKE2b-256 dd2186b678113b3831b352bd642b8acdb5962f6195936fabe7674a8e30f28004

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