This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author georg.brandl
Recipients amaury.forgeotdarc, georg.brandl, gvanrossum, ishimoto, lemburg
Date 2008-06-03.10:13:48
SpamBayes Score 0.0028690177
Marked as misclassified No
Message-id <1212488036.32.0.623029581987.issue2630@psf.upfronthosting.co.za>
In-reply-to
Content
Review:

* Why is an empty string not printable? In any case, the empty string
should be among the test cases for isprintable().

* Why not use PyUnicode_DecodeASCII instead of
PyUnicode_FromEncodedObject? It should be a bit faster.

* If old-style string formatting gets "%a", .format() must get a "!a"
specifier.

* The ascii() and repr() tests should be expanded so that both test the
same set of objects, and the expected differences. Are there tests for
failing cases?

* This is just "return ascii" (in builtin_ascii):
+	if (ascii == NULL)
+	    return NULL;
+
+	return ascii;

* For PyBool_FromLong(1) and PyBool_FromLong(0) there is Py_RETURN_TRUE
and Py_RETURN_FALSE. (You're not to blame, the rest of unicodeobject.c
seems to use them too, probably a legacy.)

* There appear to be some space indentations in tab-indented files like
bltinmodule.c and vice versa (unicodeobject.c).

* C docs/isprintable() docs: The spec
+   Characters defined in the Unicode character database as "Other"
+   or "Separator" other than ASCII space(0x20) are not considered
+   printable.
is unclear, better say "All character except those ... are considered
printable".

* ascii() docs: 
+   the non-ASCII
+   characters in the string returned by :func:`ascii`() are hex-escaped
+   to generate a same string as :func:`repr` in Python 2.

should be

"the non-ASCII characters in the string returned by :func:`repr` are
backslash-escaped (with ``\x``, ``\u`` or ``\U``) to generate ...".

* makeunicodedata: len(list(n for n in names if n is not None)) could
better be expressed as sum(1 for n in names if n is not None).

Otherwise, the patch is fine IMO. (I'm surprised that only so few tests
needed adaptation, that's a sign that we're not testing Unicode enough.)
History
Date User Action Args
2008-06-03 10:13:57georg.brandlsetspambayes_score: 0.00286902 -> 0.0028690177
recipients: + georg.brandl, lemburg, gvanrossum, ishimoto, amaury.forgeotdarc
2008-06-03 10:13:56georg.brandlsetspambayes_score: 0.00286902 -> 0.00286902
messageid: <1212488036.32.0.623029581987.issue2630@psf.upfronthosting.co.za>
2008-06-03 10:13:53georg.brandllinkissue2630 messages
2008-06-03 10:13:50georg.brandlcreate