Serhiy Storchaka added the comment:

> The lowest impact fix from a code change would be to add a type equivalence 
> check for constants as Raymond first suggested, as that only involves adding 
> an extra check to code_richcompare: 
> https://hg.python.org/cpython/file/tip/Objects/codeobject.c#l416

It is not so easy. (1,) and (1.0,) are equal and have the same type. To make 
correct type-sensitive equivalence check, you need to introduce new protocol, 
new special method on low level and new operator/function on high level.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25843>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to