[pypy-commit] pypy cpyext-ext: add TODO for cpyext

fijal pypy.commits at gmail.com
Fri Feb 26 03:51:31 EST 2016


Author: fijal
Branch: cpyext-ext
Changeset: r82525:0984da240844
Date: 2016-02-26 09:49 +0100
http://bitbucket.org/pypy/pypy/changeset/0984da240844/

Log:	add TODO for cpyext

diff --git a/TODO b/TODO
new file mode 100644
--- /dev/null
+++ b/TODO
@@ -0,0 +1,5 @@
+* finish PySequence_Fast
+* typeobject.py and handling of __float__ prevents us from using pypy
+* python setup.py install in numpy does not somehow tell setuptools
+  it's installed (I bet it's about the py27 tag)
+* implement PyFile_AsFile
diff --git a/pypy/module/cpyext/sequence.py b/pypy/module/cpyext/sequence.py
--- a/pypy/module/cpyext/sequence.py
+++ b/pypy/module/cpyext/sequence.py
@@ -48,8 +48,6 @@
         # make sure we can return a borrowed obj from PySequence_Fast_GET_ITEM    
         w_obj.convert_to_cpy_strategy(space)
         return w_obj
-    if isinstance(w_obj, tupleobject.W_TupleObject):
-        return w_obj
     try:
         return listobject.W_ListObject.newlist_cpyext(space, space.listview(w_obj))
     except OperationError:
diff --git a/pypy/module/cpyext/slotdefs.py b/pypy/module/cpyext/slotdefs.py
--- a/pypy/module/cpyext/slotdefs.py
+++ b/pypy/module/cpyext/slotdefs.py
@@ -11,7 +11,7 @@
     getattrfunc, getattrofunc, setattrofunc, lenfunc, ssizeargfunc, inquiry,
     ssizessizeargfunc, ssizeobjargproc, iternextfunc, initproc, richcmpfunc,
     cmpfunc, hashfunc, descrgetfunc, descrsetfunc, objobjproc, objobjargproc,
-    readbufferproc)
+    readbufferproc, ssizessizeobjargproc)
 from pypy.module.cpyext.pyobject import from_ref, make_ref, Py_DecRef
 from pypy.module.cpyext.pyerrors import PyErr_Occurred
 from pypy.module.cpyext.state import State
@@ -170,6 +170,15 @@
     func_target = rffi.cast(ternaryfunc, func)
     return generic_cpy_call(space, func_target, w_self, w_args, w_kwds)
 
+def wrap_ssizessizeobjargproc(space, w_self, w_args, func):
+    func_target = rffi.cast(ssizessizeobjargproc, func)
+    check_num_args(space, w_args, 3)
+    args_w = space.fixedview(w_args)
+    i = space.int_w(space.index(args_w[0]))
+    j = space.int_w(space.index(args_w[1]))
+    w_y = args_w[2]
+    return space.wrap(generic_cpy_call(space, func_target, w_self, i, j, w_y))
+
 def wrap_lenfunc(space, w_self, w_args, func):
     func_len = rffi.cast(lenfunc, func)
     check_num_args(space, w_args, 0)


More information about the pypy-commit mailing list