[issue41777] When using `python -bb`, `struct.calcsize` raises a warning when used with str argument after being used with bytes (might be a larger problem with dicts)

Edson Tadeu M. Manoel report at bugs.python.org
Sun Sep 13 09:35:30 EDT 2020


Edson Tadeu M. Manoel <e.tadeu at gmail.com> added the comment:

> I'm not sure if this warning is intentional, since in Python 3 there seems to be no special reason for dicts to try to compare 'a' with b'a' (other than possible implementation details).

Okay, there's one special reason, it's the fact that 'a' and b'a' have the same hash. I'm not sure about the expected behavior, though.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41777>
_______________________________________


More information about the Python-bugs-list mailing list