Skip to content

Commit 7a30496

Browse files
committed
bpo-45045 Add unbound method test case
1 parent c95a7ea commit 7a30496

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Lib/test/test_patma.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,6 +2641,19 @@ def f(x):
26412641
self.assertEqual(f((False, range(-1, -11, -1), True)), alts[3])
26422642
self.assertEqual(f((False, range(10, 20), True)), alts[4])
26432643

2644+
def test_patma_248(self):
2645+
class C(dict):
2646+
@staticmethod
2647+
def get(key, default=None):
2648+
return 'bar'
2649+
2650+
x = C({'foo': 'bar'})
2651+
match x:
2652+
case {'foo': bar}:
2653+
y = bar
2654+
2655+
self.assertEqual(y, 'bar')
2656+
26442657

26452658
class TestSyntaxErrors(unittest.TestCase):
26462659

0 commit comments

Comments
 (0)