[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-12-10 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-12-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset c15f122617d5 by Martin Panter in branch '3.5': Issue #26483: Clarify str.isdecimal() and isdigit() https://hg.python.org/cpython/rev/c15f122617d5 New changeset bc7fc85beed1 by Martin Panter in branch '3.6': Issues #28916, #26483: Merge stdtypes.rst

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-12-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: docs@python -> martin.panter ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-12-09 Thread Martin Panter
Martin Panter added the comment: I’m okay with this version unless anyone has any more improvements. -- stage: patch review -> commit review ___ Python tracker ___ __

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-12-07 Thread Julien Palard
Changes by Julien Palard : Added file: http://bugs.python.org/file45793/issue26483.diff ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-12-01 Thread Julien Palard
Julien Palard added the comment: “digits which do not form decimal radix forms” > “forming a form” seems a long way of saying very little. The difference seems > a bit vague > I gather that digits not in the Unicode “decimal digit” category are often > (always?) still decimal digits I expect

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-11-30 Thread Martin Panter
Martin Panter added the comment: “digits which do not form decimal radix forms” I see you have taken this from a Unicode document, but “forming a form” seems a long way of saying very little. The difference seems a bit vague, but I gather that digits not in the Unicode “decimal digit” category

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-11-26 Thread Julien Palard
Julien Palard added the comment: Proposing a patch. -- keywords: +patch Added file: http://bugs.python.org/file45653/issue26483.diff ___ Python tracker ___ __

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-12 Thread Julien
Julien added the comment: To dig further, the DIGIT_MASK and DECIMAL_MASK used in `unicodeobject.c` are from `unicodectype.c` and they match values from `unicodetype_db.h` witch is generated by `Tools/unicode/makeunicodedata.py` which built those masks this way: # decimal digit, integer d

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-12 Thread Anna Koroliuk
Anna Koroliuk added the comment: Hi, all! At Helsinki Python sprint I with the kind help of Ezio found two things. 1) This code gives results which are attached in the file. I will just now show some interesting cases where isdigit() and isdecimal() give different results. for c in map(chr,

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-11 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +terry.reedy versions: -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: AFAIK ‘general category “Nd” ’ is the same as ‘the property value Numeric_Type=Decimal’. Yet one related predicate is str.isnumeric(). https://docs.python.org/3/library/stdtypes.html?#str.isnumeric Return true if all characters in the string are numeric cha

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-06 Thread Martin Panter
Martin Panter added the comment: The documentation could certainly be clarified to say that all decimals, as determined by isdecimal(), are also digits as determined by isdigit(). IMO the current documentation is confusing or wrong to stay that decimals ‘include digit characters’; it is actual

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes. For details you need to read The Unicode Standard. And every decimal character is accepted by the int() constructor, but non-decimal digits are not. >>> for d in decimals: x = int(d) ... >>> for d in set(digits) - set(decimals): ... try: ...

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-04 Thread Ethan Furman
Ethan Furman added the comment: I like those code snippets! Thanks, Serhiy! Just to make sure I have understood correctly: every decimal char is also a digit char, but some digit chars are not decimal chars. -- ___ Python tracker

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> chars = ''.join(map(chr, range(sys.maxunicode+1))) >>> digits = ''.join(filter(str.isdigit, chars)) >>> digits '0123456789²³¹٠١٢٣٤٥٦٧٨٩۰۱۲۳۴۵۶۷۸۹߀߁߂߃߄߅߆߇߈߉०१२३४५६७८९০১২৩৪৫৬৭৮৯੦੧੨੩੪੫੬੭੮੯૦૧૨૩૪૫૬૭૮૯୦୧୨୩୪୫୬୭୮୯௦௧௨௩௪௫௬௭௮௯౦౧౨౩౪౫౬౭౮౯೦೧೨೩೪೫೬೭೮೯൦൧൨൩൪൫൬൭൮൯෦෧෨෩෪෫෬෭෮෯๐๑

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-04 Thread Ezio Melotti
Changes by Ezio Melotti : -- assignee: -> docs@python components: +Documentation, Unicode nosy: +docs@python, ezio.melotti, haypo stage: -> needs patch type: -> enhancement versions: +Python 3.6 ___ Python tracker

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-03-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- title: docs unclear on difference between isdigt() and isdecimal() -> docs unclear on difference between str.isdigit() and str.isdecimal() ___ Python tracker __