Marc-Andre Lemburg added the comment:
On 22.11.2013 12:24, Marc-Andre Lemburg wrote:
>
> Nick: I've had a look at your second patch. A couple of notes:
>
> * I think you should add the flag to the constructor of the CodecInfo
> tuple subclass and then set this in the resp. codecs. The extra
> constructor class method looks too much like a hack and is
> not needed.
Like this:
_is_text_encoding = True # Assume codecs are text encodings by default
def __new__(cls, encode, decode, streamreader=None, streamwriter=None,
incrementalencoder=None, incrementaldecoder=None, name=None,
_is_text_encoding=None):
self = tuple.__new__(cls, (encode, decode, streamreader, streamwriter))
self.name = name
self.encode = encode
self.decode = decode
self.incrementalencoder = incrementalencoder
self.incrementaldecoder = incrementaldecoder
self.streamwriter = streamwriter
self.streamreader = streamreader
if _is_text_encoding is not None:
self._is_text_encoding = _is_text_encoding
return self
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue19619>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com