Nick Coghlan added the comment:
Serhiy's patch looks to me like it would pragmatically cover all the cases most
likely to affect porting efforts: using the standard library bytes<->bytes
codecs through the convenience methods.
For a Python 2 backport, I'm slightly more concerned with exposing the argument
in the constructor signature, but see value in being consistent with Python 3
if anyone decides to use this to check a custom codec.
The main advantage this approach has over the typecheck based approach is that
it can correctly warn about "data".encode("hex"), while a typecheck based
approach can't distinguish that from "text".encode("ascii")
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue19543>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com