On 16 November 2013 21:38, Nick Coghlan <ncogh...@gmail.com> wrote: > On 16 November 2013 20:45, Victor Stinner <victor.stin...@gmail.com> wrote: >> Why not using str type for str and str subtypes, and bytes type for bytes >> and bytes-like object (bytearray, memoryview)? I don't think that we need an >> ABC here. > > We'd only need an ABC if info was added for supported input types. > However, that's not necessary since "encodes_to" and "decodes_to" are > enough to identify Unicode encodings: "encodes_to in (None, bytes) and > decodes_to in (None, str)", so we don't need to track input type > support at all if the main question we want to answer is "is this a > Unicode codec or not?".
I realised I misunderstood your proposal because of the field names you initially suggested. I've now proposed a variation with different field names (encodes_to instead of output_type and decodes_to instead of input_type) and a "codecs.is_text_encoding" query function (http://bugs.python.org/issue19619?#msg203037) Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com