Undocumented
Function | _apply_placeholder_attr_to_class |
Undocumented |
Function | add_additional_orm_attributes |
Apply __init__, __table__ and other attributes to the mapped class. |
Function | apply_mypy_mapped_attr |
Undocumented |
Function | apply_type_to_mapped_statement |
Apply the Mapped[<type>] annotation and right hand object to a declarative assignment statement. |
Function | re_apply_declarative_assignments |
For multiple class passes, re-apply our left-hand side types as mypy seems to reset them in place. |
Undocumented
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
cls:ClassDef | Undocumented |
qualified_name:str | Undocumented |
attrname:str | Undocumented |
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
attributes:List[ | Undocumented |
Undocumented
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
item:Union[ | Undocumented |
attributes:List[ | Undocumented |
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>
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
stmt:AssignmentStmt | Undocumented |
lvalue:NameExpr | Undocumented |
left_hand_explicit_type:Optional[ | Undocumented |
python_type_for_type:Optional[ | Undocumented |
Parameters | |
api:SemanticAnalyzerPluginInterface | Undocumented |
attributes:List[ | Undocumented |