This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: LC_CTYPE locale and strings
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: loewis, ppessi
Priority: normal Keywords: patch

Created on 2004-07-26 01:36 by ppessi, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
lc_ctype.patch ppessi, 2004-07-26 01:36 Patch adding missing locale-dependent ctype functions to string objects
Messages (3)
msg46466 - (view) Author: Pekka Pessi (ppessi) Date: 2004-07-26 01:36
It would be nice to get access to complete
locale-specific ctype information:

iscntrl()
isgraph()
isprint()
ispunct()

Also, the string.uppercase and string.lowercase depend
on LC_CTYPE locale. The string module has two other
members that could depend on LC_CTYPE,
string.punctuation and string.printable.

The current docs (in
http://www.python.org/doc/2.3.4/lib/module-string.html)
on string.printable is misleading, as string.printable
is not changed after LC_CTYPE locale changes, and it is
always
printable = digits + ascii_letters + punctuation +
whitespace

My approach is to create string.printable and
string.punctuation based on locale information, just
like string.uppercase and string.lowercase is done, and
add string.ascii_punctuation and string.ascii_printable
for the C locale values.

Patch containing proposed changes in stringobject,
string and _locale modules attached. No tests nor
changes to the docs, sorry.
msg46467 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-07-26 12:58
Logged In: YES 
user_id=21627

Why do you need these functions?

It is convention that the Unicode type provides the same or
more methods, can you provide a patch that has a meaningful
definition for these methods for Unicode strings?

Reclassifying issue as a patch.
msg46468 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-08-22 16:17
Logged In: YES 
user_id=21627

I personally don't see a need for these functions. As the
submitter cannot explain the need, either, I'm rejecting the
patch.
History
Date User Action Args
2022-04-11 14:56:05adminsetgithub: 40643
2004-07-26 01:36:21ppessicreate