E
Erik Max Francis
Steven said:In that case, the name is misleadingly wrong. I suppose it is not likely
that it could be changed before Python 3?
Why?
The primary purpose of the .isdigit, etc. methods is to test whether a
single character has a certain property. There is, however, no special
character data type in Python, and so by necessity those methods must be
on strings, not characters.
Thus, you have basically two choices: Have the methods throw exceptions
for strings with a length different from one, or have them just iterate
over every character in a string. The latter is clearly a more useful
functionality.