On Wed, May 16, 2012 at 5:07 PM, Thomas 'PointedEars' Lahn <pointede...@web.de> 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 in str: 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 if all characters in S are digits and there is at least one character in S, False otherwise. --- Although pydoc is still really bad compared to the web/reST documentation. (This has been noted by others.) --- By the way, is it worth filing a bug report on the wording of str.isdecimal()? It seems to imply that ''.isdecimal() should be true. (It isn't.) Especially when compared like that to isdigit, which makes a point of noting this particular edge case. -- Devin -- http://mail.python.org/mailman/listinfo/python-list