bpo-43764: Fix __match_args__ generation logic for dataclasses (GH-25284)

This commit is contained in:
Brandt Bucher 2021-04-08 12:54:34 -07:00 committed by GitHub
parent 28d28e053d
commit d92c59f486
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View file

@ -3432,6 +3432,14 @@ class TestMatchArgs(unittest.TestCase):
__match_args__ = ma
self.assertIs(C(42).__match_args__, ma)
def test_bpo_43764(self):
@dataclass(repr=False, eq=False, init=False)
class X:
a: int
b: int
c: int
self.assertEqual(X.__match_args__, ("a", "b", "c"))
if __name__ == '__main__':
unittest.main()