mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
20 lines
315 B
Python
20 lines
315 B
Python
from functools import singledispatch
|
|
|
|
|
|
@singledispatch
|
|
def func(arg, kwarg=None):
|
|
"""A function for general use."""
|
|
pass
|
|
|
|
|
|
@func.register(int)
|
|
def _func_int(arg, kwarg=None):
|
|
"""A function for int."""
|
|
pass
|
|
|
|
|
|
@func.register(str)
|
|
def _func_str(arg, kwarg=None):
|
|
"""A function for str."""
|
|
pass
|