Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-17 Thread Terry Reedy
On 5/17/2012 4:23 AM, Devin Jeanpierre wrote: str.isdecimal = isdecimal(...) S.isdecimal() -> bool Return True if there are only decimal characters in S, False otherwise. Help on method_descriptor in str: str.isdigit = isdigit(...) S.isdigit() -> bool Return True i

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-17 Thread Devin Jeanpierre
On Wed, May 16, 2012 at 5:07 PM, Thomas 'PointedEars' Lahn wrote: > RTFM. > > $ python3 -c 'print("42".isdecimal.__doc__ + "\n"); > print("42".isdigit.__doc__)' Heh, don't print docstrings. Use pydoc. $ ( export PAGER=cat && pydoc3 str.isdecimal && pydoc3 str.isdigit ) Help on method_descriptor

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-17 Thread Marco
On 05/17/2012 02:15 AM, Steven D'Aprano wrote: the Fine Manual has more detail, although I admit it isn't *entirely* clear what it is talking about if you're not a Unicode expert: http://docs.python.org/py3k/library/stdtypes.html#str.isdecimal You are right, that is clear, thanks :) Exampl

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread Steven D'Aprano
On Wed, 16 May 2012 17:48:19 +0200, Marco wrote: > Hi all, because > > "There should be one-- and preferably only one --obvious way to do it", > > there should be a difference between the two methods in the subject, but > I can't find it: The Fine Manual has more detail, although I admit it isn

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread Ian Kelly
On Wed, May 16, 2012 at 3:07 PM, Thomas 'PointedEars' Lahn wrote: > RTFM. > > $ python3 -c 'print("42".isdecimal.__doc__ + "\n"); > print("42".isdigit.__doc__)' > S.isdecimal() -> bool > > Return True if there are only decimal characters in S, > False otherwise. > > S.isdigit() -> bool > > Return

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread Thomas 'PointedEars' Lahn
Marco wrote: > Hi all, because > > "There should be one-- and preferably only one --obvious way to do it", > > there should be a difference between the two methods in the subject, but > I can't find it: > > >>> '123'.isdecimal(), '123'.isdigit() > (True, True) > >>> print('\u0660123') > ٠123

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread jmfauth
On 16 mai, 17:48, Marco wrote: > Hi all, because > > "There should be one-- and preferably only one --obvious way to do it", > > there should be a difference between the two methods in the subject, but > I can't find it: > >  >>> '123'.isdecimal(), '123'.isdigit() > (True, True) >  >>> print('\u06

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread Marco
On 05/16/2012 06:24 PM, Ulrich Eckhardt wrote: Marco wrote: >>>> '123'.isdecimal(), '123'.isdigit() > (True, True) >>>> print('\u0660123') > ٠123 >>>> '\u0660123'.isdigit(), '\u0660123'.isdecimal() > (True, True) >>>> print('\u216B') > Ⅻ >>>> '\u216B'.isdecimal(), '

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread Ian Kelly
On Wed, May 16, 2012 at 10:24 AM, Ulrich Eckhardt wrote: > Marco wrote: >>  >>> '123'.isdecimal(), '123'.isdigit() >> (True, True) >>  >>> print('\u0660123') >> ٠123 >>  >>> '\u0660123'.isdigit(), '\u0660123'.isdecimal() >> (True, True) >>  >>> print('\u216B') >> Ⅻ >>  >>> '\u216B'.isdecimal(), '\

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread Ulrich Eckhardt
Marco wrote: > >>> '123'.isdecimal(), '123'.isdigit() > (True, True) > >>> print('\u0660123') > ٠123 > >>> '\u0660123'.isdigit(), '\u0660123'.isdecimal() > (True, True) > >>> print('\u216B') > Ⅻ > >>> '\u216B'.isdecimal(), '\u216B'.isdigit() > (False, False) [chr(a) for a in range(0x2) if

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread MRAB
On 16/05/2012 16:48, Marco wrote: Hi all, because "There should be one-- and preferably only one --obvious way to do it", there should be a difference between the two methods in the subject, but I can't find it: >>> '123'.isdecimal(), '123'.isdigit() (True, True) >>> print('\u0660123') ٠

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread Ian Kelly
On Wed, May 16, 2012 at 9:48 AM, Marco wrote: > Hi all, because > > "There should be one-- and preferably only one --obvious way to do it", > > there should be a difference between the two methods in the subject, but I > can't find it: > '123'.isdecimal(), '123'.isdigit() > (True, True)

Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread Marco
Hi all, because "There should be one-- and preferably only one --obvious way to do it", there should be a difference between the two methods in the subject, but I can't find it: >>> '123'.isdecimal(), '123'.isdigit() (True, True) >>> print('\u0660123') ٠123 >>> '\u0660123'.isdigit(), '\u06601