bpo-43977: Make sure that tp_flags for pattern matching are inherited correctly. (GH-25813)

This commit is contained in:
Mark Shannon 2021-05-03 00:38:22 +01:00 committed by GitHub
parent 9387fac100
commit 33ec88ac81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 69 additions and 8 deletions

View file

@ -1967,6 +1967,12 @@ class TestCollectionABCs(ABCTestCase):
self.assertEqual(len(mss), len(mss2))
self.assertEqual(list(mss), list(mss2))
def test_illegal_patma_flags(self):
with self.assertRaises(TypeError):
class Both(Collection):
__abc_tpflags__ = (Sequence.__flags__ | Mapping.__flags__)
################################################################################
### Counter