Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions mypy/plugins/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@

TD_SETDEFAULT_NAMES: Final = {n + ".setdefault" for n in TPDICT_FB_NAMES}
TD_POP_NAMES: Final = {n + ".pop" for n in TPDICT_FB_NAMES}
TD_DELITEM_NAMES: Final = {n + ".__delitem__" for n in TPDICT_FB_NAMES}

TD_UPDATE_METHOD_NAMES: Final = (
{n + ".update" for n in TPDICT_FB_NAMES}
Expand Down Expand Up @@ -144,11 +145,11 @@ def get_method_hook(self, fullname: str) -> Callable[[MethodContext], Type] | No
return int_pos_callback
elif fullname in ("builtins.tuple.__mul__", "builtins.tuple.__rmul__"):
return tuple_mul_callback
elif fullname in {n + ".setdefault" for n in TPDICT_FB_NAMES}:
elif fullname in TD_SETDEFAULT_NAMES:
return typed_dict_setdefault_callback
elif fullname in {n + ".pop" for n in TPDICT_FB_NAMES}:
elif fullname in TD_POP_NAMES:
return typed_dict_pop_callback
elif fullname in {n + ".__delitem__" for n in TPDICT_FB_NAMES}:
elif fullname in TD_DELITEM_NAMES:
return typed_dict_delitem_callback
elif fullname == "_ctypes.Array.__getitem__":
return array_getitem_callback
Expand Down