Guido van Rossum wrote: > A concern I'd have with fixing this is that Unicode objects also > support the buffer API. In any situation where either str or unicode > is accepted I'd be reluctant to guess whether a buffer object was > meant to be str-like or Unicode-like. I think this covers all the > cases you mention here.
iirc, SRE solves that by comparing the length of the sequence with the number of bytes in the buffer. if length == bytes, it's an 8-bit string; if length*sizeof(Py_Unicode) == bytes, it's a Unicode string. </F> _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com