Ken Jin <kenjin4...@gmail.com> added the comment:
This issue is now out of date on. After Serhiy's refactoring, any function types can be unioned. >>> NewType('x', int) >>> int | NewType('x', int) int | typing.NewType.<locals>.new_type The only problem now is that the repr is weird, but Serhiy also has a fix for that in issue34963 (PR 9951) without converting to a class. Thus, I am closing the issue. Please go to issue44642 for a general discussion on whether union should support arbitrary functions at all, or issue34963 for the repr problem. Thanks all! ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed superseder: -> Union of a type and the typing module function _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44353> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com