Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44642> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com