[pypy-commit] pypy better-PyDict_Next: draft version, wip

mattip pypy.commits at gmail.com
Fri Dec 9 07:28:15 EST 2016


Author: Matti Picus <matti.picus at gmail.com>
Branch: better-PyDict_Next
Changeset: r88984:68ef60b6a404
Date: 2016-12-05 22:52 +0200
http://bitbucket.org/pypy/pypy/changeset/68ef60b6a404/

Log:	draft version, wip

diff --git a/pypy/module/cpyext/dictobject.py b/pypy/module/cpyext/dictobject.py
--- a/pypy/module/cpyext/dictobject.py
+++ b/pypy/module/cpyext/dictobject.py
@@ -261,13 +261,17 @@
         return 0
     w_key = space.listview(w_keys)[pos]
     w_value = space.getitem(w_dict, w_key)
-    if isinstance(w_value, GetSetProperty):
-        # XXX doesn't quite work, need to convert GetSetProperty
-        #     to PyGetSetDef, with c_name, c_get, c_set, c_doc, c_closure
-        w_value = W_GetSetPropertyEx(w_value, w_dict.dstorage._x)
     if pkey:
         pkey[0]   = as_pyobj(space, w_key)
     if pvalue:
+        if 0 and isinstance(w_value, GetSetProperty):
+            # XXX implement this method for all W_Dict storage strategies
+            w_type = w_dict.get_storage().get_original_type_object_if_classdict()
+            # XXX doesn't quite work, need to convert GetSetProperty
+            #     to PyGetSetDef, with c_name, c_get, c_set, c_doc, c_closure
+            #     Do this by calling a make_typedescr(GetSetProperty)?
+            py_getsetdef = as_pyobj(space, w_value)
+            w_value = W_GetSetPropertyEx(py_getsetdef, w_type)
         pvalue[0] = as_pyobj(space, w_value)
     return 1
 


More information about the pypy-commit mailing list