Undocumented
Function | extract |
Undocumented |
Function | infer |
Determine the type based on explicit annotation only. |
Function | infer |
Undocumented |
Function | _infer |
Undocumented |
Function | _infer |
Infer the type of mapping from a Column. |
Function | _infer |
Infer the type of mapping from a ColumnProperty. |
Function | _infer |
Infer the type of mapping from a Composite. |
Function | _infer |
Validate type when a left hand annotation is present and we also could infer the right hand side:: |
Function | _infer |
Infer the type of mapping from a right side expression that returns Mapped. |
Function | _infer |
Infer the type of mapping from a relationship. |
SemanticAnalyzerPluginInterface
, node: TypeInfo
, type_args: Sequence[ Expression]
) -> ProperType
:
(source)
¶
Undocumented
SemanticAnalyzerPluginInterface
, node: Var
, left_hand_explicit_type: Optional[ ProperType]
) -> Optional[ ProperType]
:
(source)
¶
Determine the type based on explicit annotation only. if no annotation were present, note that we need one there to know the type.
SemanticAnalyzerPluginInterface
, stmt: AssignmentStmt
, node: Var
, left_hand_explicit_type: Optional[ ProperType]
, infer_from_right_side: RefExpr
) -> Optional[ ProperType]
:
(source)
¶
Undocumented
SemanticAnalyzerPluginInterface
, node: Var
, left_hand_explicit_type: Instance
, python_type_for_type: Instance
) -> Optional[ ProperType]
:
(source)
¶
Undocumented
SemanticAnalyzerPluginInterface
, stmt: AssignmentStmt
, node: Var
, left_hand_explicit_type: Optional[ ProperType]
, right_hand_expression: Optional[ CallExpr]
= None) -> Optional[ ProperType]
:
(source)
¶
Infer the type of mapping from a Column. E.g.:: @reg.mapped class MyClass: # ... a = Column(Integer) b = Column("b", String) c: Mapped[int] = Column(Integer) d: bool = Column(Boolean) Will resolve in MyPy as:: @reg.mapped class MyClass: # ... a : Mapped[int] b : Mapped[str] c: Mapped[int] d: Mapped[bool]
SemanticAnalyzerPluginInterface
, stmt: AssignmentStmt
, node: Var
, left_hand_explicit_type: Optional[ ProperType]
) -> Optional[ ProperType]
:
(source)
¶
Infer the type of mapping from a ColumnProperty. This includes mappings against ``column_property()`` as well as the ``deferred()`` function.
SemanticAnalyzerPluginInterface
, stmt: AssignmentStmt
, node: Var
, left_hand_explicit_type: Optional[ ProperType]
) -> Optional[ ProperType]
:
(source)
¶
Infer the type of mapping from a Composite.
SemanticAnalyzerPluginInterface
, node: Var
, left_hand_explicit_type: ProperType
, python_type_for_type: ProperType
, orig_left_hand_type: Optional[ ProperType]
= None, orig_python_type_for_type: Optional[ ProperType]
= None) -> Optional[ ProperType]
:
(source)
¶
Validate type when a left hand annotation is present and we also could infer the right hand side:: attrname: SomeType = Column(SomeDBType)
SemanticAnalyzerPluginInterface
, stmt: AssignmentStmt
, node: Var
, left_hand_explicit_type: Optional[ ProperType]
, infer_from_right_side: RefExpr
) -> Optional[ ProperType]
:
(source)
¶
Infer the type of mapping from a right side expression that returns Mapped.
SemanticAnalyzerPluginInterface
, stmt: AssignmentStmt
, node: Var
, left_hand_explicit_type: Optional[ ProperType]
) -> Optional[ ProperType]
:
(source)
¶
Infer the type of mapping from a relationship. E.g.:: @reg.mapped class MyClass: # ... addresses = relationship(Address, uselist=True) order: Mapped["Order"] = relationship("Order") Will resolve in mypy as:: @reg.mapped class MyClass: # ... addresses: Mapped[List[Address]] order: Mapped["Order"]