odata_query.typing module
- odata_query.typing.infer_return_type(node: odata_query.ast.Call) Optional[Type[odata_query.ast._Node]][source]
Tries to infer the type of a function call
node.- Parameters
node – The node to infer the type for.
- Returns
The inferred type or
Noneif unable to infer.
- odata_query.typing.infer_type(node: odata_query.ast._Node) Optional[Type[odata_query.ast._Node]][source]
Tries to infer the type of
node.- Parameters
node – The node to infer the type for.
- Returns
The inferred type or
Noneif unable to infer.
- odata_query.typing.typecheck(node: odata_query.ast._Node, expected_type: Union[Type, Tuple[Type, ...]], field_name: str) None[source]
Checks that the inferred type of
nodeis (one) ofexpected_type, and raisesArgumentTypeExceptionif not.- Parameters
node – The node to type check.
expected_type – The allowed type(s) the node can have.
field_name – The name of the field you’re typechecking. Only used in the exception.
- Raises