[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)

2020-09-13 Thread Florian Bruhin
Florian Bruhin added the comment: Ah, also see https://bugs.python.org/issue21071#msg292409 where the same thing was mentioned as part of another issue as well. After some discussions in the Python IRC channel, I guess it's acceptable for dicts to raise a ByteWarning here - after all, there

[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)

2020-09-13 Thread Edson Tadeu M. Manoel
Edson Tadeu M. Manoel 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'

[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)

2020-09-13 Thread Florian Bruhin
Florian Bruhin added the comment: Taking the freedom of adding people involved in the `struct` module to the nosy list. -- nosy: +The Compiler, mark.dickinson, meador.inge ___ Python tracker

[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)

2020-09-13 Thread Edson Tadeu M. Manoel
New submission from Edson Tadeu M. Manoel : Here is the inconsistent behavior, when running with `python -bb` (or just `python -b`), caused by an internal cache: >>> import struct >>> struct.calcsize(b'!d') # cache for '!d' uses bytes 8 >>> struct.calcsize('!d') # so there's