8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent abd1628 commit 4e068d4Copy full SHA for 4e068d4
Lib/test/test_functools.py
@@ -2474,6 +2474,26 @@ def _(arg):
2474
self.assertTrue(A.t(''))
2475
self.assertEqual(A.t(0.0), 0.0)
2476
2477
+ def test_staticmethod__slotted_class(self):
2478
+ class A:
2479
+ __slots__ = ['a']
2480
+ @functools.singledispatchmethod
2481
+ def t(arg):
2482
+ return arg
2483
+ @t.register(int)
2484
+ @staticmethod
2485
+ def _(arg):
2486
+ return isinstance(arg, int)
2487
+ @t.register(str)
2488
2489
2490
+ return isinstance(arg, str)
2491
+ a = A()
2492
+
2493
+ self.assertTrue(A.t(0))
2494
+ self.assertTrue(A.t(''))
2495
+ self.assertEqual(A.t(0.0), 0.0)
2496
2497
def test_classmethod_register(self):
2498
class A:
2499
def __init__(self, arg):
0 commit comments