Skip to content

PEP 484 - type annotations examples

Handsdown API Index / Examples / PEP 484 - type annotations examples

Auto-generated documentation for examples.typed module.

MyValue

Show source in typed.py:11

Signature

class MyValue:
    ...

Typed

Show source in typed.py:15

Signature

class Typed:
    def __init__(
        self,
        _value: Union[List[str], str, MyValue] = MyValue(
            {
                "key1": "value1",
                "key2": "value2",
                "key3": "value3",
                "key4": "value4",
                "key5": "value5",
                "key6": "value6",
            }
        ),
        _name: str = "default",
    ) -> Dict[str, MyValue]:
        ...

See also

Typed().async_method

Show source in typed.py:37

Signature

async def async_method(self, _value: str) -> str:
    ...

Typed.classmethod

Show source in typed.py:33

Signature

@classmethod
def classmethod(cls, _my_value: MyValue, *_args: str, **_kwargs: Any) -> None:
    ...

See also

func

Show source in typed.py:45

Signature

@my_deco(key="value")
def func(
    _list: Tuple[List[str], ...], _my_value_cls: Type[MyValue] = MyValue, **_kwargs: None
) -> Optional[MyValue]:
    ...

See also

my_deco

Show source in typed.py:41

Signature

def my_deco(key):
    ...