module documentation
Undocumented
Function | add |
Apply __init__, __table__ and other attributes to the mapped class. |
Function | apply |
Undocumented |
Function | apply |
Apply the Mapped[<type>] annotation and right hand object to a declarative assignment statement. |
Function | re |
For multiple class passes, re-apply our left-hand side types as mypy seems to reset them in place. |
Function | _apply |
Undocumented |
def add_additional_orm_attributes(cls:
ClassDef
, api: SemanticAnalyzerPluginInterface
, attributes: List[ util.SQLAlchemyAttribute]
):
(source)
¶
Apply __init__, __table__ and other attributes to the mapped class.
def apply_mypy_mapped_attr(cls:
ClassDef
, api: SemanticAnalyzerPluginInterface
, item: Union[ NameExpr, StrExpr]
, attributes: List[ util.SQLAlchemyAttribute]
):
(source)
¶
Undocumented
def apply_type_to_mapped_statement(api:
SemanticAnalyzerPluginInterface
, stmt: AssignmentStmt
, lvalue: NameExpr
, left_hand_explicit_type: Optional[ ProperType]
, python_type_for_type: Optional[ ProperType]
):
(source)
¶
Apply the Mapped[<type>] annotation and right hand object to a declarative assignment statement. This converts a Python declarative class statement such as:: class User(Base): # ... attrname = Column(Integer) To one that describes the final Python behavior to Mypy:: class User(Base): # ... attrname : Mapped[Optional[int]] = <meaningless temp node>
def re_apply_declarative_assignments(cls:
ClassDef
, api: SemanticAnalyzerPluginInterface
, attributes: List[ util.SQLAlchemyAttribute]
):
(source)
¶
For multiple class passes, re-apply our left-hand side types as mypy seems to reset them in place.