Skip to content

typing

Tools for typing support helper.

copy_type

copy_type(f: _T) -> Callable[[Any], _T]

Copy types for args, kwargs from parent class.

Source code in src/astx/tools/typing.py
19
20
21
22
23
@public
def copy_type(f: _T) -> Callable[[Any], _T]:
    """Copy types for args, kwargs from parent class."""
    skip_unused(f)
    return lambda x: x

skip_unused

skip_unused(*args: Any, **kwargs: Any) -> None

Referencing variables to pacify static analyzers.

Source code in src/astx/tools/typing.py
10
11
12
13
14
15
16
@public
def skip_unused(*args: Any, **kwargs: Any) -> None:
    """Referencing variables to pacify static analyzers."""
    for arg in args:
        pass
    for key in kwargs:
        pass