Skip to content

Commit caafa17

Browse files
committed
Add hint, satisfy self type-checking
1 parent 84edf6d commit caafa17

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mypy/typeanal.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,15 +819,14 @@ def try_analyze_special_unbound_type(self, t: UnboundType, fullname: str) -> Typ
819819
)
820820
return AnyType(TypeOfAny.from_error)
821821
item = t.args[0]
822-
if not isinstance(get_proper_type(item), TypedDictType):
822+
if not isinstance(item, TypedDictType): # type: ignore[misc]
823823
self.fail(
824824
"Argument to TypedDict[] must be a literal dictionary mapping item names to types",
825825
t,
826826
code=codes.VALID_TYPE,
827827
)
828828
return AnyType(TypeOfAny.from_error)
829-
else:
830-
item.is_pep764 = True
829+
item.is_pep764 = True
831830
return self.anal_type(item, allow_typed_dict_special_forms=True)
832831
return None
833832

mypy/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,6 +2585,7 @@ class TypedDictType(ProperType):
25852585

25862586
extra_items_from: list[ProperType] # only used during semantic analysis
25872587
to_be_mutated: bool # only used in a plugin for `.update`, `|=`, etc
2588+
is_pep764: bool
25882589

25892590
def __init__(
25902591
self,

0 commit comments

Comments
 (0)