Roundup Robot devn...@psf.upfronthosting.co.za 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
Roundup Robot devn...@psf.upfronthosting.co.za 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 rep...@bugs.python.org
Ezio Melotti ezio.melo...@gmail.com added the comment:
Fixed, thanks for the report!
--
resolution: duplicate - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12266
Roundup Robot devn...@psf.upfronthosting.co.za 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
Ezio Melotti ezio.melo...@gmail.com added the comment:
Attached patch + tests.
--
keywords: +patch
Added file: http://bugs.python.org/file22898/issue12266.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12266
Marc-Andre Lemburg m...@egenix.com 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 =
Ezio Melotti ezio.melo...@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
Marc-Andre Lemburg m...@egenix.com added the comment:
Ezio Melotti wrote:
Ezio Melotti ezio.melo...@gmail.com 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 =
Ezio Melotti ezio.melo...@gmail.com 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
py.user port...@yandex.ru added the comment:
[c for c in all_chars if c not in L and ...
L ?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12266
___
Ezio Melotti ezio.melo...@gmail.com added the comment:
L = set(sum([Ll, Lu, Lt, Lo, Lm], []))
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12266
___
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +belopolsky, eric.araujo, ezio.melotti, lemburg
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12266
___
Ezio Melotti ezio.melo...@gmail.com 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
Changes by py.user port...@yandex.ru:
--
title: str.capitalize contradicts - str.capitalize contradicts oneself
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12266
___
14 matches
Mail list logo