"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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4