Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r59126:1fbbf6afc0b3
Date: 2012-11-29 11:47 -0800
http://bitbucket.org/pypy/pypy/changeset/1fbbf6afc0b3/

Log:    add type.__prepare__

diff --git a/pypy/objspace/std/test/test_typeobject.py 
b/pypy/objspace/std/test/test_typeobject.py
--- a/pypy/objspace/std/test/test_typeobject.py
+++ b/pypy/objspace/std/test/test_typeobject.py
@@ -1113,6 +1113,14 @@
         assert marker is Z
         """
 
+    def test_prepare(self):
+        classdict = type.__prepare__()
+        assert type(classdict) is dict
+        assert classdict == {}
+        assert type.__prepare__(3) == {}
+        assert type.__prepare__(3, 4) == {}
+        assert type.__prepare__(3, package='sqlalchemy') == {}
+
 
 class AppTestWithMethodCacheCounter:
     spaceconfig = {"objspace.std.withmethodcachecounter": True}
diff --git a/pypy/objspace/std/typetype.py b/pypy/objspace/std/typetype.py
--- a/pypy/objspace/std/typetype.py
+++ b/pypy/objspace/std/typetype.py
@@ -255,6 +255,9 @@
     w_type = _check(space, w_type)
     return space.newlist(w_type.get_subclasses())
 
+def descr___prepare__(space, __args__):
+    return space.newdict()
+
 # ____________________________________________________________
 
 type_typedef = StdTypeDef("type",
@@ -273,4 +276,5 @@
                                          descr_del___abstractmethods__),
     __subclasses__ = gateway.interp2app(descr___subclasses__),
     __weakref__ = weakref_descr,
+    __prepare__ = gateway.interp2app(descr___prepare__),
     )
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to