[issue20049] string.lowercase and string.uppercase can contain garbage

Stefan Krah report at bugs.python.org
Sun Dec 22 16:34:02 CET 2013


Stefan Krah added the comment:

Alexander, the "domain fo the function" probably refers to
the range [-1, 256].

C99:
====

The header <ctype.h> declares several functions useful for classifying and mapping
characters.166) In all cases the argument is an int, the value of which shall be
representable as an unsigned char or shall equal the value of the macro EOF. If the
argument has any other value, the behavior is undefined.
2 The behavior of these functions is affected by the current locale. Those functions that
 have locale-specific aspects only when not in the "C" locale are noted below.
3 The term printing character refers to a member of a locale-specific set of characters, each
 of which occupies one printing position on a display device; the term control character
refers to a member of a locale-specific set of characters that are not printing
characters.167) All letters and digits are printing characters.
Forward references: EOF (7.19.1), localization (7.11).
7.4.1 Character classification functions
1
The functions in this subclause return nonzero (true) if and only if the value of the
argument c conforms to that in the description of the function.


I think this agrees with what Antoine has said.

----------
nosy: +skrah

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20049>
_______________________________________


More information about the Python-bugs-list mailing list