On 3 February 2014 16:10, Phil Thompson <phil at riverbankcomputing.com> wrote: > That doesn't answer my original question, that just works around the use > case I presented. > > To restate... > > Why is a Latin-1 string considered inconsistent just because it doesn't > happen to contain any characters in the range 128-255? Butting in here (sorry) but I thought what Victor was trying to say is that being able to say that a string marked as Latin1 "kind" definitely has characters >127 allows the code to optimise some tests (for example, two strings cannot be equal if their kinds differ). Obviously, requiring this kind of constraint makes it somewhat harder for user code to construct string objects that conform to the spec. That's why the PyUnicode_FromKindAndData function has the convenience feature of doing the check and setting the kind correctly for you - you should use that rather than trying to get the details right yourself.. Paul.
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