diff --git a/mypyc/irbuild/classdef.py b/mypyc/irbuild/classdef.py index 59b1c05a0ddb..fcb2afba0939 100644 --- a/mypyc/irbuild/classdef.py +++ b/mypyc/irbuild/classdef.py @@ -498,6 +498,9 @@ def populate_non_ext_bases(builder: IRBuilder, cdef: ClassDef) -> Value: if builder.options.capi_version < (3, 8): # TypedDict was added to typing in Python 3.8. module = "typing_extensions" + # It needs to be "_TypedDict" on typing_extensions 4.7.0+ + # and "TypedDict" otherwise. + name = "_TypedDict" else: # In Python 3.9 TypedDict is not a real type. name = "_TypedDict"