[Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]
Josiah Carlson
jcarlson at uci.edu
Fri Feb 17 23:18:39 CET 2006
More information about the Python-Dev mailing list
Fri Feb 17 23:18:39 CET 2006
- Previous message: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]
- Next message: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Martin v. Löwis" <martin at v.loewis.de> wrote: > M.-A. Lemburg wrote: > > Just because some codecs don't fit into the string.decode() > > or bytes.encode() scenario doesn't mean that these codecs are > > useless or that the methods should be banned. > > No. The reason to ban string.decode and bytes.encode is that > it confuses users. How are users confused? bytes.encode CAN only produce bytes. Though string.decode (or bytes.decode) MAY produce strings (or bytes) or unicode, depending on the codec, I think it is quite reasonable to expect that users will understand that string.decode('utf-8') is different than string.decode('base-64'), and that they may produce different output. In a similar fashion, dict.get(1) may produce different results than dict.get(2) for some dictionaries. If some users can't understand this (passing different arguments to a function may produce different output), then I think that some users are broken beyond repair. - Josiah
- Previous message: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]
- Next message: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list