[pypy-svn] r73244 - pypy/branch/cpython-extension/pypy/module/cpyext

xoraxax at codespeak.net xoraxax at codespeak.net
Thu Apr 1 15:54:07 CEST 2010


Author: xoraxax
Date: Thu Apr  1 15:54:05 2010
New Revision: 73244

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/api.py
Log:
ANN: cpyext is now translatable and can at least load and use the famous foo extension module! In this changeset, I just reformat the code and add the PyList_Type.

Modified: pypy/branch/cpython-extension/pypy/module/cpyext/api.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/api.py	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/api.py	Thu Apr  1 15:54:05 2010
@@ -223,8 +223,12 @@
                  'BaseException']:
     GLOBALS['PyExc_' + exc_name] = ('PyObject*', 'space.w_' + exc_name)
 
-for cpyname, pypyexpr in [("Type", "space.w_type"), ("BaseObject", "space.w_object"),
-        ("Dict", "space.w_dict"), ("Tuple", "space.w_tuple")]:
+for cpyname, pypyexpr in {"Type": "space.w_type",
+        "BaseObject": "space.w_object",
+        "Dict": "space.w_dict",
+        "Tuple": "space.w_tuple",
+        "List": "space.w_list",
+        }.items():
     GLOBALS['Py%s_Type#' % (cpyname, )] = ('PyTypeObject*', pypyexpr)
 
 def get_structtype_for_ctype(ctype):



More information about the Pypy-commit mailing list