Am 04.10.11 19:50, schrieb Antoine Pitrou:
On Tue, 04 Oct 2011 19:49:09 +0200
"Martin v. Löwis"<mar...@v.loewis.de>  wrote:

+        result = PyUnicode_New(slicelength, PyUnicode_MAX_CHAR_VALUE(self));

This is incorrect: the maxchar of the slice might be smaller than the
maxchar of the input string.

I thought that heuristic would be good enough. I'll try to fix it.

No - strings must always be in the canonical form. For example,
PyUnicode_RichCompare considers string unequal if they have different
kinds. As a consequence, your slice result may not compare equal to
a canonical variant of itself.
_______________________________________________
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

Reply via email to