MCPcopy Create free account
hub / github.com/python/mypy / check_lvalue_validity

Method check_lvalue_validity

mypy/semanal.py:4703–4707  ·  view source on GitHub ↗
(self, node: Expression | SymbolNode | None, ctx: Context)

Source from the content-addressed store, hash-verified

4701 return isinstance(node, Var) and node.is_self
4702
4703 def check_lvalue_validity(self, node: Expression | SymbolNode | None, ctx: Context) -> None:
4704 if isinstance(node, TypeVarExpr):
4705 self.fail("Invalid assignment target", ctx)
4706 elif isinstance(node, TypeInfo):
4707 self.fail(message_registry.CANNOT_ASSIGN_TO_TYPE, ctx)
4708
4709 def store_declared_types(self, lvalue: Lvalue, typ: Type) -> None:
4710 if isinstance(lvalue, RefExpr):

Calls 2

failMethod · 0.95
isinstanceFunction · 0.85

Tested by

no test coverage detected