mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
32 lines
768 B
Python
32 lines
768 B
Python
from functools import singledispatchmethod
|
|
|
|
|
|
class Foo:
|
|
"""docstring"""
|
|
|
|
@singledispatchmethod
|
|
@classmethod
|
|
def class_meth(cls, arg, kwarg=None):
|
|
"""A class method for general use."""
|
|
pass
|
|
|
|
@class_meth.register(int)
|
|
@class_meth.register(float)
|
|
@classmethod
|
|
def _class_meth_int(cls, arg, kwarg=None):
|
|
"""A class method for numbers."""
|
|
pass
|
|
|
|
@class_meth.register(str)
|
|
@classmethod
|
|
def _class_meth_str(cls, arg, kwarg=None):
|
|
"""A class method for str."""
|
|
pass
|
|
|
|
@class_meth.register
|
|
@classmethod
|
|
def _class_meth_dict(cls, arg: dict, kwarg=None):
|
|
"""A class method for dict."""
|
|
# This function tests for specifying type through annotations
|
|
pass
|