This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kj
Recipients JelleZijlstra, domdfcoding, gvanrossum, joperez, kj, levkivskyi, uriyyo
Date 2021-07-20.01:32:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626744777.52.0.911067950993.issue44353@roundup.psfhosted.org>
In-reply-to
Content
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!
History
Date User Action Args
2021-07-20 01:32:57kjsetrecipients: + kj, gvanrossum, levkivskyi, JelleZijlstra, uriyyo, joperez, domdfcoding
2021-07-20 01:32:57kjsetmessageid: <1626744777.52.0.911067950993.issue44353@roundup.psfhosted.org>
2021-07-20 01:32:57kjlinkissue44353 messages
2021-07-20 01:32:57kjcreate