[issue25843] code_richcompare() don't use constant type when comparing code constants

Serhiy Storchaka report at bugs.python.org
Thu Jan 21 05:22:10 EST 2016


Serhiy Storchaka added the comment:

I meant that set shouldn't be handled in _PyCode_ConstantKey at all. Only frozenset constants can be considered equal. Sets as well as lists all should be different.

There is yet one issue with string and bytes literals. When run Python with the -b option:

>>> a, b = lambda: 'a', lambda: b'a'
sys:1: BytesWarning: Comparison between bytes and string
sys:1: BytesWarning: Comparison between bytes and string

May be the type should be the first item in the key.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25843>
_______________________________________


More information about the Python-bugs-list mailing list