On 21 Dec 2005 14:36:32 -0800 in comp.lang.python, Paul Rubin
<http://phr...@NOSPAM.invalid> wrote:Following your logic to its conclusion, had the name isdigits been
>There is a third choice which is the natural and obvious one: have the
>function do what its name indicates. Return true if the arg is a
>digit and false otherwise. If iterating over the whole string is
>useful (which it may be), then the function should have been named
>differently, like .isdigits instead of .isdigit.
chosen, '1'.isdigits() should return False. It's only one digit, not
more than one, as the plural would imply.
I, for one, don't see any utility in the dichotomy. We only need
Someone's been trotting out that old jwz chestnut about regular
>FWIW, I've usually tested for digit strings with re.match. It never
expressions and problems... Not that I agree with it, but ISTM that
regular expressions are vast overkill for this problem.
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.