[pypy-commit] pypy py3k: __metaclass__ no longer works, use (metaclass=...) instead
antocuni
noreply at buildbot.pypy.org
Wed Mar 14 19:53:56 CET 2012
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r53586:f08f361a2faa
Date: 2012-03-14 17:50 +0100
http://bitbucket.org/pypy/pypy/changeset/f08f361a2faa/
Log: __metaclass__ no longer works, use (metaclass=...) instead
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
@@ -475,14 +475,16 @@
"""
def test_mro(self):
+ """
class A_mro(object):
a = 1
- class B_mro(A_mro):
+ class mymeta(type):
+ def mro(self):
+ return [self, object]
+
+ class B_mro(A_mro, metaclass=mymeta):
b = 1
- class __metaclass__(type):
- def mro(self):
- return [self, object]
assert B_mro.__bases__ == (A_mro,)
assert B_mro.__mro__ == (B_mro, object)
@@ -493,6 +495,7 @@
assert getattr(B_mro(), 'a', None) == None
# also check what the built-in mro() method would return for 'B_mro'
assert type.mro(B_mro) == [B_mro, A_mro, object]
+ """
def test_abstract_mro(self):
"""
More information about the pypy-commit
mailing list