Message397847
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! |
|
Date |
User |
Action |
Args |
2021-07-20 01:32:57 | kj | set | recipients:
+ kj, gvanrossum, levkivskyi, JelleZijlstra, uriyyo, joperez, domdfcoding |
2021-07-20 01:32:57 | kj | set | messageid: <1626744777.52.0.911067950993.issue44353@roundup.psfhosted.org> |
2021-07-20 01:32:57 | kj | link | issue44353 messages |
2021-07-20 01:32:57 | kj | create | |
|