Skip to content

omnipy.shared.typedefs

Shared type aliases and protocol-based callable definitions.

CLASS DESCRIPTION
Method

Protocol for bound methods with preserved parameter and return types.

ATTRIBUTE DESCRIPTION
GeneralDecorator

LocaleType

TYPE: TypeAlias

P

RetT

TypeForm

TYPE: TypeAlias

GeneralDecorator module-attribute

GeneralDecorator = Callable[[Callable], Callable]

LocaleType module-attribute

LocaleType: TypeAlias = str | tuple[str | None, str | None]

P module-attribute

P = ParamSpec('P')

RetT module-attribute

RetT = TypeVar('RetT', covariant=True)

Method

Bases: Protocol, Generic[P, RetT]


              flowchart BT
              omnipy.shared.typedefs.Method[Method]

              

              click omnipy.shared.typedefs.Method href "" "omnipy.shared.typedefs.Method"
            

Protocol for bound methods with preserved parameter and return types.

Source code in src/omnipy/shared/typedefs.py
class Method(Protocol, Generic[P, RetT]):
    """Protocol for bound methods with preserved parameter and return types."""
    def __call__(self: Self, *args: P.args, **kwargs: P.kwargs) -> RetT:
        ...