A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2011-October/113838.html below:

[Python-Dev] [Python-checkins] cpython: Optimize string slicing to use the new API

[Python-Dev] [Python-checkins] cpython: Optimize string slicing to use the new API [Python-Dev] [Python-checkins] cpython: Optimize string slicing to use the new API"Martin v. Löwis" martin at v.loewis.de
Tue Oct 4 20:09:06 CEST 2011
Am 04.10.11 19:50, schrieb Antoine Pitrou:
> On Tue, 04 Oct 2011 19:49:09 +0200
> "Martin v. Löwis"<martin at 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.
More information about the Python-Dev mailing list

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