M.-A. Lemburg writes: > def encode(self,u): > > """ Return the Unicode object u encoded as Python string. This should accept an optional slice parameter, and use it in the same way as .dump(). > def dump(self,u,stream,slice=None): ... > def load(self,stream,length=None): Why not have something like .wrapFile(f) that returns a file-like object with all the file methods implemented, and doing to "right thing" regarding encoding/decoding? That way, the new file-like object can be used directly with code that works with files and doesn't care whether it uses 8-bit or unicode strings. > Codecs should raise an UnicodeError in case the conversion is > not possible. I think that should be ValueError, or UnicodeError should be a subclass of ValueError. (Can the -X interpreter option be removed yet?) -Fred -- Fred L. Drake, Jr. <fdrake@acm.org> Corporation for National Research Initiatives
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