[Python-Dev] Re: When to remove BytesWarning?

2020-11-11 Thread John Hagen
If I recall, it was str(bytes) warning that flagged in a few places and was 
missing a .decode() call or similar.

It seems like the bytes== warnings could be implemented in a type checker such 
as mypy, if it doesn't
already do this. Assuming you have correct type coverage/inference on your 
project, you could
potentially catch this at static analysis time rather than runtime.
___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/SN2HQG6KQGGQB2SOF2NKCIWQVF6UWKKU/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: When to remove BytesWarning?

2020-11-11 Thread Serhiy Storchaka
11.11.20 15:05, John Hagen пише:
> If I recall, it was str(bytes) warning that flagged in a few places and was 
> missing a .decode() call or similar.
> 
> It seems like the bytes== warnings could be implemented in a type checker 
> such as mypy, if it doesn't
> already do this. Assuming you have correct type coverage/inference on your 
> project, you could
> potentially catch this at static analysis time rather than runtime.

There were several bugs like sep=='/' (where sep can be bytes) in the
stdlib. These cases were not covered by tests, so they were fixed only
in 3.3 or even later. I hope all such bugs are already fixed, but I
cannot guarantee.

And there were bugs with str(bytes) too.
___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/OQNQIEKS3UTPIHROL66OTQIRG3NX67D6/
Code of Conduct: http://python.org/psf/codeofconduct/