消息 [397569]
It is only reminder that our test for NewType is arbitrary. And it is not compatible with PR 9951. Possible solutions are:
1. Make NewType a class and add more strict test. Pro -- we can make arbitrary repr, contra -- it has small negative effect on performance. See issue34963.
2. Remove the test for NewType at all and allow or-ing types and arbitrary functions.
3. Introduce a special attribute to distinguish unionable objects. It will make the code of unionobject.c simpler.
I lean towards option 1 (not excluding 3). Small performance losses seem inevitable. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2021-07-15 16:47:27 | serhiy.storchaka | 修改 | recipients:
+ serhiy.storchaka, gvanrossum, kj |
| 2021-07-15 16:47:27 | serhiy.storchaka | 修改 | messageid: <1626367647.84.0.0409964892759.issue44642@roundup.psfhosted.org> |
| 2021-07-15 16:47:27 | serhiy.storchaka | 链接 | issue44642 messages |
| 2021-07-15 16:47:27 | serhiy.storchaka | 创建 | |
|