Why does TypedDict not have a MRO
May 31, 2021
10:22 a.m.
This recently came up in https://bugs.python.org/issue41249. The problem described in the issue is that `get_type_hints` does not work on a TypedDict if it subclasses a TypedDict from another module which contains string annotations and has different globals than the module from which `get_type_hints` is called. As `get_type_hint` is unable to access the MRO of the class it is unable to access those globals. Given that postponed evaluation is now the default this is even more problematic. However what is the reason that TypedDict do not preserve MRO?
1874
Age (days ago)
1874
Last active (days ago)
0 comments
1 participants
participants (1)
-
Nils K