[pypy-commit] pypy default: Implement the (empty) PyType_Modified() function
amauryfa
noreply at buildbot.pypy.org
Sat Jun 4 01:11:09 CEST 2011
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch:
Changeset: r44671:893564d5f764
Date: 2011-05-27 18:33 +0200
http://bitbucket.org/pypy/pypy/changeset/893564d5f764/
Log: Implement the (empty) PyType_Modified() function
diff --git a/pypy/module/cpyext/stubs.py b/pypy/module/cpyext/stubs.py
--- a/pypy/module/cpyext/stubs.py
+++ b/pypy/module/cpyext/stubs.py
@@ -2254,15 +2254,6 @@
standard C library function exit(status)."""
raise NotImplementedError
- at cpython_api([PyObject, Py_ssize_t, Py_ssize_t], PyObject)
-def PyTuple_GetSlice(space, p, low, high):
- """Take a slice of the tuple pointed to by p from low to high and return it
- as a new tuple.
-
- This function used an int type for low and high. This might
- require changes in your code for properly supporting 64-bit systems."""
- raise NotImplementedError
-
@cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
def PyTuple_ClearFreeList(space):
"""Clear the free list. Return the total number of freed items.
@@ -2275,14 +2266,6 @@
"""
raise NotImplementedError
- at cpython_api([PyTypeObjectPtr], lltype.Void)
-def PyType_Modified(space, type):
- """Invalidate the internal lookup cache for the type and all of its
- subtypes. This function must be called after any manual
- modification of the attributes or base classes of the type.
- """
- raise NotImplementedError
-
@cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
def PyType_IS_GC(space, o):
"""Return true if the type object includes support for the cycle detector; this
diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py
--- a/pypy/module/cpyext/typeobject.py
+++ b/pypy/module/cpyext/typeobject.py
@@ -650,3 +650,13 @@
name = space.str_w(w_name)
w_obj = w_type.lookup(name)
return borrow_from(w_type, w_obj)
+
+ at cpython_api([PyTypeObjectPtr], lltype.Void)
+def PyType_Modified(space, w_obj):
+ """Invalidate the internal lookup cache for the type and all of its
+ subtypes. This function must be called after any manual
+ modification of the attributes or base classes of the type.
+ """
+ # PyPy already takes care of direct modifications to type.__dict__
+ # (which is a W_DictProxyObject).
+ pass
More information about the pypy-commit
mailing list