Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 605 Bytes

File metadata and controls

30 lines (18 loc) · 605 Bytes

singledispatch-native

Native version of functools.singledispatch written in Rust

Getting Started

singledispatch-native can be installed from PyPI using e.g. pip install singledispatch-native.

Usage is identical to the builtin functools.singledispatch:

from typing import Any

from singledispatch_native import singledispatch

@singledispatch
def f(o: Any) -> str:
    return "Any"


@f.register(str)
def f(o: str) -> str:
    return o

License

Copyright (c) 2025 Chris Rink

Apache License 2.0