Undocumented
Function | _infer_collection_type_from_left_and_inferred_right |
Undocumented |
Function | _infer_type_from_decl_column |
Infer the type of mapping from a Column. |
Function | _infer_type_from_decl_column_property |
Infer the type of mapping from a ColumnProperty. |
Function | _infer_type_from_decl_composite_property |
Infer the type of mapping from a CompositeProperty. |
Function | _infer_type_from_left_and_inferred_right |
Validate type when a left hand annotation is present and we also could infer the right hand side: |
Function | _infer_type_from_relationship |
Infer the type of mapping from a relationship. |
Function | extract_python_type_from_typeengine |
Undocumented |
Function | infer_type_from_left_hand_type_only |
Determine the type based on explicit annotation only. |
Function | infer_type_from_right_hand_nameexpr |
Undocumented |
Undocumented
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
node:Var | Undocumented |
left_hand_explicit_type:Instance | Undocumented |
python_type_for_type:Instance | Undocumented |
Returns | |
Optional[ | Undocumented |
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]
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
stmt:AssignmentStmt | Undocumented |
node:Var | Undocumented |
left_hand_explicit_type:Optional[ | Undocumented |
right_hand_expression:Optional[ | Undocumented |
Returns | |
Optional[ | Undocumented |
Infer the type of mapping from a ColumnProperty.
This includes mappings against column_property() as well as the deferred() function.
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
stmt:AssignmentStmt | Undocumented |
node:Var | Undocumented |
left_hand_explicit_type:Optional[ | Undocumented |
Returns | |
Optional[ | Undocumented |
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
stmt:AssignmentStmt | Undocumented |
node:Var | Undocumented |
left_hand_explicit_type:Optional[ | Undocumented |
Returns | |
Optional[ | Undocumented |
Validate type when a left hand annotation is present and we also could infer the right hand side:
attrname: SomeType = Column(SomeDBType)
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
node:Var | Undocumented |
left_hand_explicit_type:ProperType | Undocumented |
python_type_for_type:ProperType | Undocumented |
orig_left_hand_type:Optional[ | Undocumented |
orig_python_type_for_type:Optional[ | Undocumented |
Returns | |
Optional[ | Undocumented |
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"]
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
stmt:AssignmentStmt | Undocumented |
node:Var | Undocumented |
left_hand_explicit_type:Optional[ | Undocumented |
Returns | |
Optional[ | Undocumented |
Undocumented
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
node:TypeInfo | Undocumented |
type_args:Sequence[ | Undocumented |
Returns | |
ProperType | Undocumented |
Determine the type based on explicit annotation only.
if no annotation were present, note that we need one there to know the type.
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
node:Var | Undocumented |
left_hand_explicit_type:Optional[ | Undocumented |
Returns | |
Optional[ | Undocumented |
Undocumented
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
stmt:AssignmentStmt | Undocumented |
node:Var | Undocumented |
left_hand_explicit_type:Optional[ | Undocumented |
infer_from_right_side:RefExpr | Undocumented |
Returns | |
Optional[ | Undocumented |