[pypy-svn] r38465 - in pypy/dist/pypy: interpreter objspace objspace/std

arigo at codespeak.net arigo at codespeak.net
Sun Feb 11 15:48:05 CET 2007


Author: arigo
Date: Sun Feb 11 15:48:02 2007
New Revision: 38465

Modified:
   pypy/dist/pypy/interpreter/baseobjspace.py
   pypy/dist/pypy/objspace/dump.py
   pypy/dist/pypy/objspace/logic.py
   pypy/dist/pypy/objspace/std/objspace.py
   pypy/dist/pypy/objspace/std/unicodeobject.py
   pypy/dist/pypy/objspace/thunk.py
Log:
Add a space.unichars_w() as a hack to get at the list of characters of a unicode string.


Modified: pypy/dist/pypy/interpreter/baseobjspace.py
==============================================================================
--- pypy/dist/pypy/interpreter/baseobjspace.py	(original)
+++ pypy/dist/pypy/interpreter/baseobjspace.py	Sun Feb 11 15:48:02 2007
@@ -922,6 +922,7 @@
     'float_w',
     'uint_w',
     'bigint_w',
+    'unichars_w',
     'interpclass_w',
     'unwrap',
     'is_true',

Modified: pypy/dist/pypy/objspace/dump.py
==============================================================================
--- pypy/dist/pypy/objspace/dump.py	(original)
+++ pypy/dist/pypy/objspace/dump.py	Sun Feb 11 15:48:02 2007
@@ -145,6 +145,7 @@
         'int_w': 1,
         'float_w': 1,
         'uint_w': 1,
+        'unichars_w': 1,
         'bigint_w': 1,
         'interpclass_w': 1,
         'unwrap': 1,

Modified: pypy/dist/pypy/objspace/logic.py
==============================================================================
--- pypy/dist/pypy/objspace/logic.py	(original)
+++ pypy/dist/pypy/objspace/logic.py	Sun Feb 11 15:48:02 2007
@@ -69,6 +69,7 @@
         'int_w': 1,
         'float_w': 1,
         'uint_w': 1,
+        'unichars_w': 1,
         'bigint_w': 1,
         'interpclass_w': 1,
         'unwrap': 1,

Modified: pypy/dist/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/dist/pypy/objspace/std/objspace.py	(original)
+++ pypy/dist/pypy/objspace/std/objspace.py	Sun Feb 11 15:48:02 2007
@@ -573,6 +573,7 @@
         str_w   = StdObjSpaceMultiMethod('str_w', 1, [])     # returns an unwrapped string
         float_w = StdObjSpaceMultiMethod('float_w', 1, [])   # returns an unwrapped float
         uint_w  = StdObjSpaceMultiMethod('uint_w', 1, [])    # returns an unwrapped unsigned int (r_uint)
+        unichars_w = StdObjSpaceMultiMethod('unichars_w', 1, [])    # returns an unwrapped list of unicode characters
         bigint_w = StdObjSpaceMultiMethod('bigint_w', 1, []) # returns an unwrapped rbigint
         marshal_w = StdObjSpaceMultiMethod('marshal_w', 1, [], extra_args=['marshaller'])
         log     = StdObjSpaceMultiMethod('log', 1, [], extra_args=['base'])

Modified: pypy/dist/pypy/objspace/std/unicodeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/unicodeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/unicodeobject.py	Sun Feb 11 15:48:02 2007
@@ -59,6 +59,9 @@
 def str_w__Unicode(space, w_uni):
     return space.str_w(space.str(w_uni))
 
+def unichars_w__Unicode(space, w_uni):
+    return w_uni._value
+
 def str__Unicode(space, w_uni):
     return space.call_method(w_uni, 'encode')
 

Modified: pypy/dist/pypy/objspace/thunk.py
==============================================================================
--- pypy/dist/pypy/objspace/thunk.py	(original)
+++ pypy/dist/pypy/objspace/thunk.py	Sun Feb 11 15:48:02 2007
@@ -117,6 +117,7 @@
         'int_w': 1,
         'float_w': 1,
         'uint_w': 1,
+        'unichars_w': 1,
         'bigint_w': 1,
         'interpclass_w': 1,
         'unwrap': 1,



More information about the Pypy-commit mailing list