[pypy-svn] r12503 - pypy/branch/non-fake-unicode/pypy/objspace/std

ac at codespeak.net ac at codespeak.net
Thu May 19 10:04:31 CEST 2005


Author: ac
Date: Thu May 19 10:04:31 2005
New Revision: 12503

Modified:
   pypy/branch/non-fake-unicode/pypy/objspace/std/unicodeobject.py
Log:
Add a primitive stringformatting to unicode.

Modified: pypy/branch/non-fake-unicode/pypy/objspace/std/unicodeobject.py
==============================================================================
--- pypy/branch/non-fake-unicode/pypy/objspace/std/unicodeobject.py	(original)
+++ pypy/branch/non-fake-unicode/pypy/objspace/std/unicodeobject.py	Thu May 19 10:04:31 2005
@@ -765,10 +765,14 @@
             else:
                 raise TypeError("character mapping must return integer, None or unicode")
     return ''.join(result)
-                
+
+def mod__Unicode_ANY(format, values):
+    return unicode(format.encode("utf-8") % values, "utf-8")
+
 ''')
 unicode_expandtabs__Unicode_ANY = app.interphook('unicode_expandtabs__Unicode_ANY')
 unicode_translate__Unicode_ANY = app.interphook('unicode_translate__Unicode_ANY')
+mod__Unicode_ANY = app.interphook('mod__Unicode_ANY')
 
 import unicodetype
 register_all(vars(), unicodetype)



More information about the Pypy-commit mailing list