Message123270
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(). |
|
Date |
User |
Action |
Args |
2010-12-03 17:08:23 | belopolsky | set | recipients:
+ belopolsky, lemburg, loewis, vstinner, ezio.melotti, docs@python |
2010-12-03 17:08:23 | belopolsky | set | messageid: <1291396103.28.0.745658463289.issue10587@psf.upfronthosting.co.za> |
2010-12-03 17:08:21 | belopolsky | link | issue10587 messages |
2010-12-03 17:08:21 | belopolsky | create | |
|