symforce.typing module

Common type definitions.

class Dataclass(*args, **kwargs)[source]

Bases: ABC

Metaclass for dataclasses (which do not have a common superclass)

Parameters:
  • args (Any) –

  • kwargs (Any) –

any_args(f)[source]

Decorator to mark an abstract method as allowing subclasses to override with any argument types.

THIS LIES TO THE TYPE CHECKER, AND ALLOWS VIOLATION OF THE LISKOV SUBSTITUTION PRINCIPLE. USE ONLY ON FUNCTIONS THAT WILL NEVER BE CALLED IN A CONTEXT THAT KNOWS ONLY THE BASE TYPE.

Parameters:

f (Callable[[...], _ReturnType]) –

Return type:

Callable[[…], _ReturnType]