[issue12266] str.capitalize contradicts oneself

2011-08-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset d3816fa1bcdf by Ezio Melotti in branch '2.7': #12266: move the tests in test_unicode. http://hg.python.org/cpython/rev/d3816fa1bcdf -- ___ Python tracker

[issue12266] str.capitalize contradicts oneself

2011-08-14 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the report! -- resolution: duplicate -> fixed status: open -> closed ___ Python tracker ___ ___

[issue12266] str.capitalize contradicts oneself

2011-08-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1ea72da11724 by Ezio Melotti in branch 'default': #12266: merge with 3.2. http://hg.python.org/cpython/rev/1ea72da11724 -- ___ Python tracker

[issue12266] str.capitalize contradicts oneself

2011-08-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset c34772013c53 by Ezio Melotti in branch '3.2': #12266: Fix str.capitalize() to correctly uppercase/lowercase titlecased and cased non-letter characters. http://hg.python.org/cpython/rev/c34772013c53 New changeset eab17979a586 by Ezio Melotti in bra

[issue12266] str.capitalize contradicts oneself

2011-08-14 Thread Ezio Melotti
Ezio Melotti added the comment: Attached patch + tests. -- keywords: +patch Added file: http://bugs.python.org/file22898/issue12266.diff ___ Python tracker ___ _

[issue12266] str.capitalize contradicts oneself

2011-07-21 Thread Ezio Melotti
Ezio Melotti added the comment: L = set(sum([Ll, Lu, Lt, Lo, Lm], [])) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue12266] str.capitalize contradicts oneself

2011-07-21 Thread py.user
py.user added the comment: >>> [c for c in all_chars if c not in L and ... L ? -- ___ Python tracker ___ ___ Python-bugs-list mailin

[issue12266] str.capitalize contradicts oneself

2011-07-21 Thread Ezio Melotti
Ezio Melotti added the comment: >>> import sys; hex(sys.maxunicode) '0x10' >>> import unicodedata; unicodedata.unidata_version '6.0.0' import unicodedata all_chars = list(map(chr, range(0x11))) Ll = [c for c in all_chars if unicodedata.category(c) == 'Ll'] Lu = [c for c in all_chars if

[issue12266] str.capitalize contradicts oneself

2011-07-21 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ezio Melotti wrote: > > Ezio Melotti added the comment: > > Do you mean "if (!Py_UNICODE_ISLOWER(*s)) {" (with the '!')? Sorry, here's the correct version: if (!Py_UNICODE_ISUPPER(*s)) { *s = Py_UNICODE_TOUPPER(*s); status = 1;

[issue12266] str.capitalize contradicts oneself

2011-07-21 Thread Ezio Melotti
Ezio Melotti 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

[issue12266] str.capitalize contradicts oneself

2011-07-21 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I think it would be better to use this code: if (!Py_UNICODE_ISUPPER(*s)) { *s = Py_UNICODE_TOUPPER(*s); status = 1; } s++; while (--len > 0) { if (Py_UNICODE_ISLOWER(*s)) { *s = Py_UNICODE_TOLOWER(*s);

[issue12266] str.capitalize contradicts oneself

2011-07-20 Thread Ezio Melotti
Ezio Melotti added the comment: Indeed this seems a different issue, and might be worth fixing it. Given this definition: str.capitalize()¶ Return a copy of the string with its first character capitalized and the rest lowercased. we might implement capitalize like: >>> def mycapitalize(

[issue12266] str.capitalize contradicts oneself

2011-07-20 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +belopolsky, eric.araujo, ezio.melotti, lemburg ___ Python tracker ___ ___ Python-bugs-list mailing

[issue12266] str.capitalize contradicts oneself

2011-06-05 Thread py.user
Changes by py.user : -- title: str.capitalize contradicts -> str.capitalize contradicts oneself ___ Python tracker ___ ___ Python-bugs

[issue12266] str.capitalize contradicts

2011-06-05 Thread py.user
Changes by py.user : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue12266] str.capitalize contradicts

2011-06-05 Thread py.user
py.user added the comment: in http://bugs.python.org/issue12204 Marc-Andre Lemburg wrote: I suggest to close this ticket as invalid or to add a note to the documentation explaining how the mapping is applied (and when not). this problem is another str.capitalize makes the first character big, b

[issue12266] str.capitalize contradicts

2011-06-05 Thread R. David Murray
R. David Murray added the comment: This looks like a duplicate of #12204. -- nosy: +r.david.murray resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> str.upper converts to title ___ Python tracker

[issue12266] str.capitalize contradicts

2011-06-04 Thread py.user
New submission from py.user : specification str.capitalize()¶ Return a copy of the string with its first character capitalized and the rest lowercased. >>> '\u1ffc', '\u1ff3' ('ῼ', 'ῳ') >>> '\u1ffc'.isupper() False >>> '\u1ff3'.islower() True >>> s = '\u1ff3\u1ff3\u1ffc\u1ffc' >>> s 'ῳῳῼ