@@ -1426,6 +1426,7 @@ def analyze_typeddict_access(
14261426
14271427 if key in typ .required_keys :
14281428 # If the key is required, we know it must be present in the TypedDict.
1429+ # def (K, object=...) -> V
14291430 overload = CallableType (
14301431 arg_types = [key_type , object_type ],
14311432 arg_kinds = [ARG_POS , ARG_OPT ],
@@ -1437,7 +1438,7 @@ def analyze_typeddict_access(
14371438 overloads .append (overload )
14381439 else :
14391440 # The key is not required, but if it is present, we know its type.
1440- # def (K) -> V | None
1441+ # def (K) -> V | None (implicit default)
14411442 overload = CallableType (
14421443 arg_types = [key_type ],
14431444 arg_kinds = [ARG_POS ],
@@ -1448,7 +1449,7 @@ def analyze_typeddict_access(
14481449 )
14491450 overloads .append (overload )
14501451
1451- # fallback: def [T](K, T) -> V | T
1452+ # def [T](K, T) -> V | T (explicit default)
14521453 overload = CallableType (
14531454 variables = [tvar ],
14541455 arg_types = [key_type , tvar ],
@@ -1461,6 +1462,7 @@ def analyze_typeddict_access(
14611462 overloads .append (overload )
14621463
14631464 # finally, add fallback overload when a key is used that is not in the TypedDict
1465+ # TODO: add support for extra items (PEP 728)
14641466 # def (str, object=...) -> object
14651467 fallback_overload = CallableType (
14661468 arg_types = [str_type , object_type ],
0 commit comments