MCPcopy Index your code
hub / github.com/python/mypy / visit_dict_expr

Method visit_dict_expr

mypy/literals.py:217–223  ·  view source on GitHub ↗
(self, e: DictExpr)

Source from the content-addressed store, hash-verified

215 return self.seq_expr(e, "List")
216
217 def visit_dict_expr(self, e: DictExpr) -> Key | None:
218 if all(a and literal(a) == literal(b) == LITERAL_YES for a, b in e.items):
219 rest: tuple[Key | None, ...] = tuple(
220 (literal_hash(a) if a else None, literal_hash(b)) for a, b in e.items
221 )
222 return ("Dict",) + rest
223 return None
224
225 def visit_tuple_expr(self, e: TupleExpr) -> Key | None:
226 return self.seq_expr(e, "Tuple")

Callers

nothing calls this directly

Calls 4

allFunction · 0.85
literalFunction · 0.85
tupleClass · 0.85
literal_hashFunction · 0.85

Tested by

no test coverage detected