A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-February/132216.html below:

[Python-Dev] _PyUnicode_CheckConsistency() too strict?

[Python-Dev] _PyUnicode_CheckConsistency() too strict? [Python-Dev] _PyUnicode_CheckConsistency() too strict?Phil Thompson phil at riverbankcomputing.com
Mon Feb 3 16:13:21 CET 2014
_PyUnicode_CheckConsistency() checks that the contents of the string 
matches the _KIND of the string. However it does this in a very strict 
manner, ie. that the contents *exactly* match the _KIND rather than just 
detecting an inconsistency between the contents and the _KIND.

For example, a string created with a maxchar of 255 (ie. a Latin-1 
string) must contain at least one character in the range 128-255 
otherwise you get an assertion failure.

As it stands, when converting Latin-1 strings in my C extension module 
I must first check each character and specify a maxchar of 127 if the 
strings happens to only contain ASCII characters.

What is the reasoning behind the checks being so strict?

Phil
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