| Store | Cart

[Python-Dev] len(chr(i)) = 2?

From: Alexander Belopolsky <alex...@gmail.com>
Fri, 19 Nov 2010 11:53:58 -0500
I was recently surprised to learn that chr(i) can produce a string of
length 2 in python 3.x.   I suspect that I am not alone finding this
behavior non-obvious given that a mistake in Python manual stating the
contrary survived several releases.  [1]  Note that I am not arguing
that the change was bad.  In Python 2.x, \U escapes have been
producing surrogate pair on narrow builds for a long time if not since
introduction of unicode.  I do believe, however that a change like
this [2] and its consequences should be better publicized.  I have not
found any discussion of this change in PEPs or "What's new" documents.
 The closest find was a mentioning of a related issue #3280 in the 3.0
NEWS file. [3]  Since this feature will be first documented in the
Library Reference in 3.2, I wonder if it will be appropriate to
mention it in "What's new in 3.2"?

[1] http://bugs.python.org/issue7828
[2] http://svn.python.org/view?view=rev&revision=56395
[3] http://www.python.org/download/releases/3.0.1/NEWS.txt
_______________________________________________
Python-Dev mailing list
Pyth...@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev-ml%40activestate.com

Recent Messages in this Thread
Alexander Belopolsky Nov 19, 2010 04:53 pm
Antoine Pitrou Nov 19, 2010 05:17 pm
Victor Stinner Nov 19, 2010 08:23 pm
"Martin v. Löwis" Nov 19, 2010 09:43 pm
Alexander Belopolsky Nov 21, 2010 10:13 pm
M.-A. Lemburg Nov 19, 2010 10:25 pm
"Martin v. Löwis" Nov 19, 2010 10:46 pm
Stephen J. Turnbull Nov 20, 2010 04:11 am
"Martin v. Löwis" Nov 20, 2010 09:05 am
Alexander Belopolsky Nov 20, 2010 10:32 pm
Stephen J. Turnbull Nov 21, 2010 12:55 pm
R. David Murray Nov 21, 2010 05:38 pm
Raymond Hettinger Nov 21, 2010 06:17 pm
R. David Murray Nov 21, 2010 07:29 pm
Stephen J. Turnbull Nov 22, 2010 10:48 am
"Martin v. Löwis" Nov 22, 2010 11:43 am
M.-A. Lemburg Nov 22, 2010 12:47 pm
James Y Knight Nov 22, 2010 02:18 pm
Nick Coghlan Nov 22, 2010 03:37 pm
Alexander Belopolsky Nov 22, 2010 04:03 pm
Nick Coghlan Nov 22, 2010 04:13 pm
Alexander Belopolsky Nov 22, 2010 05:00 pm
R. David Murray Nov 22, 2010 05:30 pm
Alexander Belopolsky Nov 22, 2010 05:37 pm
R. David Murray Nov 22, 2010 07:50 pm
Stephen J. Turnbull Nov 23, 2010 04:18 pm
Stephen J. Turnbull Nov 23, 2010 03:00 pm
Terry Reedy Nov 22, 2010 05:41 pm
Raymond Hettinger Nov 22, 2010 06:29 pm
Alexander Belopolsky Nov 22, 2010 07:09 pm
Stephen J. Turnbull Nov 23, 2010 12:15 pm
Raymond Hettinger Nov 22, 2010 06:13 pm
M.-A. Lemburg Nov 22, 2010 06:53 pm
Alexander Belopolsky Nov 23, 2010 07:11 pm
M.-A. Lemburg Nov 23, 2010 07:31 pm
Terry Reedy Nov 23, 2010 10:44 pm
Greg Ewing Nov 23, 2010 11:49 pm
James Y Knight Nov 24, 2010 12:22 am
Glyph Lefkowitz Nov 24, 2010 01:52 am
Stephen J. Turnbull Nov 24, 2010 02:44 am
Glyph Lefkowitz Nov 24, 2010 03:27 am
Stephen J. Turnbull Nov 24, 2010 05:07 am
James Y Knight Nov 24, 2010 06:26 am
Stephen J. Turnbull Nov 24, 2010 09:03 am
Greg Ewing Nov 25, 2010 02:35 am
Stephen J. Turnbull Nov 25, 2010 03:55 am
Glyph Lefkowitz Nov 26, 2010 07:51 am
Glyph Lefkowitz Nov 26, 2010 07:21 am
James Y Knight Nov 24, 2010 06:27 am
Stephen J. Turnbull Nov 24, 2010 09:51 am
Antoine Pitrou Nov 24, 2010 10:27 am
Greg Ewing Nov 25, 2010 12:19 am
Stephen J. Turnbull Nov 24, 2010 02:29 am
Amaury Forgeot dArc Nov 23, 2010 07:19 pm
Alexander Belopolsky Nov 24, 2010 05:37 pm
M.-A. Lemburg Nov 24, 2010 06:50 pm
Alexander Belopolsky Nov 24, 2010 08:06 pm
Stephen J. Turnbull Nov 25, 2010 02:17 am
Alexander Belopolsky Nov 25, 2010 04:37 am
M.-A. Lemburg Nov 25, 2010 09:57 am
Stephen J. Turnbull Nov 26, 2010 03:02 am
Terry Reedy Nov 25, 2010 05:39 am
M.-A. Lemburg Nov 25, 2010 09:51 am
Stephen J. Turnbull Nov 26, 2010 02:42 am
Greg Ewing Nov 25, 2010 03:19 am
Stephen J. Turnbull Nov 22, 2010 06:14 am
"Martin v. Löwis" Nov 21, 2010 06:51 pm
Stephen J. Turnbull Nov 22, 2010 05:28 am
"Martin v. Löwis" Nov 22, 2010 08:20 am
Stephen J. Turnbull Nov 22, 2010 10:47 am
"Martin v. Löwis" Nov 22, 2010 11:22 am
Stephen J. Turnbull Nov 23, 2010 04:16 pm
Victor Stinner Nov 25, 2010 09:39 pm
Stephen J. Turnbull Nov 27, 2010 08:48 am
Messages in this thread