faust.models.typing

Parsing Type Expressions.

This module contains tools for parsing type expressions such as List[Mapping[str, Tuple[int, Tuple[str, str]]]], then converting that to a generator expression that can be used to deserialize such a structure.

class faust.models.typing.NodeType[source]

An enumeration.

ROOT = 'ROOT'
UNION = 'UNION'
ANY = 'ANY'
LITERAL = 'LITERAL'
DATETIME = 'DATETIME'
DECIMAL = 'DECIMAL'
NAMEDTUPLE = 'NAMEDTUPLE'
TUPLE = 'TUPLE'
SET = 'SET'
DICT = 'DICT'
LIST = 'LIST'
MODEL = 'MODEL'
USER = 'USER'
class faust.models.typing.TypeExpression(expr: Type, root: Optional[faust.models.typing.RootNode] = None, *, user_types: MutableMapping[Union[Type, Tuple[Type, ...]], Callable[Any, Any]] = None, date_parser: Callable[Any, datetime.datetime] = None) → None[source]
DEFAULT_NODE

alias of LiteralNode

type = 'ROOT'
compatible_types = ()
as_function(*, name: str = 'expr', argument_name: str = 'a', stacklevel: int = 1, locals: Dict[str, Any] = None, globals: Dict[str, Any] = None) → Callable[T, T][source]
Return type

Callable[[~T], ~T]

as_string(*, name: str = 'expr', argument_name: str = 'a') → str[source]
Return type

str

as_comprehension(argument_name: str = 'a') → str[source]
Return type

str

build(var: faust.models.typing.Variable, *args: Type) → str[source]
Return type

str

property has_models
Return type

bool

property has_custom_types
Return type

bool

property has_generic_types
Return type

bool

property has_nonfield_types
Return type

bool