summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_functools.py
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2015-09-07 12:16:38 (GMT)
committerLarry Hastings <larry@hastings.org>2015-09-07 12:16:38 (GMT)
commitc8c47f55e636ed86791160944ccbb1ea651476bd (patch)
treedb97b6edb082a98c6ad2abcbacb6151ee2df2049 /Lib/test/test_functools.py
parent71f9633818b3a0cbd36b0f6ed164d436b1997fe9 (diff)
parent8c85a2083fdc6188d32f1eb287151cdb7e79a54a (diff)
downloadcpython-c8c47f55e636ed86791160944ccbb1ea651476bd.zip
cpython-c8c47f55e636ed86791160944ccbb1ea651476bd.tar.gz
cpython-c8c47f55e636ed86791160944ccbb1ea651476bd.tar.bz2
Merge heads.
Diffstat (limited to 'Lib/test/test_functools.py')
-rw-r--r--Lib/test/test_functools.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index ac211c4..ae929ec 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -1491,6 +1491,24 @@ class TestSingleDispatch(unittest.TestCase):
many_abcs = [c.Mapping, c.Sized, c.Callable, c.Container, c.Iterable]
self.assertEqual(mro(X, abcs=many_abcs), expected)
+ def test_false_meta(self):
+ # see issue23572
+ class MetaA(type):
+ def __len__(self):
+ return 0
+ class A(metaclass=MetaA):
+ pass
+ class AA(A):
+ pass
+ @functools.singledispatch
+ def fun(a):
+ return 'base A'
+ @fun.register(A)
+ def _(a):
+ return 'fun A'
+ aa = AA()
+ self.assertEqual(fun(aa), 'fun A')
+
def test_mro_conflicts(self):
c = collections
@functools.singledispatch