Message244458
| Author |
ncoghlan |
| Recipients |
benjamin.peterson, brett.cannon, djmitche, lemburg, martin.panter, ncoghlan, serhiy.storchaka |
| Date |
2015年05月30日.13:59:12 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1432994353.24.0.920800943297.issue19543@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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") |
|