Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:

As discussed in issue10610, it is important to keep the gory details in one 
place and refer to it throughout the manual.   I think the Unicode terminology 
is best exposed in the unicodedata module documentation.   For string 
character-type methods, I suggest presenting an equivalent to unicodedata 
expression where possible.  For example, x.isalpha() is equivalent to 
all(unicodedata.category(c) in 'Lu Ll Lt Lm Lo' for c in x) or many be just a 
"character c is alphabetical if unicodedata.category(c) in 'Lu Ll Lt Lm Lo' is 
true.

Other examples:

isdigit() -> unicodedata.digit(c, None) is not None
isdecimal() -> unicodedata.decimal(c, None) is not None
isnumeric() -> unicodedata.numeric(c, None) is not None
isprintable()-> unicodedata.category(c) not in 'Cc Cf Cs Co Cn Zl Zp Zs'
islower() -> unicodedata.category(c) == 'Ll'
isupper() -> unicodedata.category(c) == 'Lu'
istitle() -> unicodedata.category(c) == 'Lt'
isalnum() -> isalpha() or isdecimal() or isdigit() or isnumeric()

I am not sure about equivalent to expressions for isidentifier() and isspace().

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10587>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to