On 6/22/2010 9:24 AM, Michael Urman wrote: > By idempotent-when-possible, I mean to_bytes(str_or_bytes, encoding, > errors) that would pass an instance of bytes through, or encode an > instance of str. And of course a to_str that performs similarly, > passing str through and decoding bytes. While bytes(b'abc') will give > me b'abc', neither bytes('abc') nor bytes(b'abc', 'latin-1') get me > the b'abc' I want to see. > > These are trivial functions; > I just don't fully understand why the capability isn't baked in. Possible reasons: They are special purpose functions easily built on the basic functions provided. Fine for a 3rd party library. Most people do not need them. Some might be mislead by them. As other have said, "Not every one-liner should be builtin". -- Terry Jan Reedy
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