invalid-match-args-definition / E1902ΒΆ
Message emitted:
`__match_args__` must be a tuple of strings.
Description:
Emitted if `__match_args__` isn't a tuple of strings required for match.
Problematic code:
class Book:
__match_args__ = ["title", "year"] # [invalid-match-args-definition]
def __init__(self, title, year):
self.title = title
self.year = year
Correct code:
class Book:
__match_args__ = ("title", "year")
def __init__(self, title, year):
self.title = title
self.year = year
Related links:
Created by the match_statements checker.