Nils Kattenbeck <nilskem...@gmail.com> added the comment: > The way I fixed this is I added `__forward_module__` to `typing.ForwardRef`, > so that it can resolve the forward reference with the same globals as the > ones specified by the module in `__forward_module__`. `TypedDict`'s metaclass > should then pass the dictionary’s module name to the annotations’ forward > references via the added `module`’s keyword argument in > `typing._type_check()`. I can work in a pull request with this solution and > discuss any potential problems.
While this seems like a good solution I would still like to figure out why TypedDict do not preserve MRO. Because for now I have not found a reason nor did someone on the typing-sig mailinglist have a clue. Should there (no longer) be a reason for this then this problem has a trivial solution (just re-add the MRO and use that). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41249> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com