[issue12266] str.capitalize contradicts oneself

Ezio Melotti report at bugs.python.org
Thu Jul 21 10:52:55 CEST 2011


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

Do you mean  "if (!Py_UNICODE_ISLOWER(*s)) {"  (with the '!')?

This sounds fine to me, but with this approach all the uncased characters will go through a Py_UNICODE_TO* macro, whereas with the current code only the cased ones are converted.  I'm not sure this matters too much though.

OTOH if the non-lowercase cased chars are always either upper or titlecased, checking for both should be equivalent.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12266>
_______________________________________


More information about the Python-bugs-list mailing list