[pypy-svn] r5626 - pypy/trunk/src/pypy/objspace/std/test
mwh at codespeak.net
mwh at codespeak.net
Fri Jul 23 12:02:49 CEST 2004
Author: mwh
Date: Fri Jul 23 12:02:49 2004
New Revision: 5626
Modified:
pypy/trunk/src/pypy/objspace/std/test/test_stringformat.py
Log:
add an admittedly rather whingy comment about the difference between
CPython's documentation and implementation.
Modified: pypy/trunk/src/pypy/objspace/std/test/test_stringformat.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/test/test_stringformat.py (original)
+++ pypy/trunk/src/pypy/objspace/std/test/test_stringformat.py Fri Jul 23 12:02:49 2004
@@ -80,6 +80,18 @@
self.assertEquals('<(1, 2)-(3, 4)>', '<%s-%s>' % ((1,2), (3,4)))
def test_format_dict(self):
+
+ # I'll just note that the first of these two completely
+ # contradicts what CPython's documentation says:
+
+ # When the right argument is a dictionary (or other
+ # mapping type), then the formats in the string
+ # \emph{must} include a parenthesised mapping key into
+ # that dictionary inserted immediately after the
+ # \character{\%} character.
+
+ # It is what CPython *does*, however. All software sucks.
+
self.assertEquals('<{1: 2}>', '<%s>' % {1:2})
self.assertEquals('<{1: 2}-{3: 4}>', '<%s-%s>' % ({1:2}, {3:4}))
More information about the Pypy-commit
mailing list