You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While playing around with yet another proposal for sum types (typing-sig message forthcoming), I think I found a small issue with attrs and the match statement.
To Reproduce
fromtypingimportGeneric, TypeVarfromattrsimportfrozenfromtyping_extensionsimportassert_neverT=TypeVar("T")
@frozenclassSome(Generic[T]):
val: T
So I'm going to guess it's an issue with how we generate attrs __match_args__, maybe for generic types. I might try solving this myself, or it would be awesome if someone more knowledgeable could solve it first.
If I use dataclasses it works properly.
Your Environment
Mypy version used: mypy 0.982 (compiled: yes)
Mypy command-line flags:
Mypy configuration options from mypy.ini (and other config files):
Python version used: Python 3.10.6
The text was updated successfully, but these errors were encountered:
Duplicate of #13612. This bug was fixed in #13618, which landed with v0.990.
@mgedmin Good find! That's a different bug (one that has to do with some special handling for class patterns involving builtin types). Could you please open a new issue?
Bug Report
Hello Mypy friends!
While playing around with yet another proposal for sum types (typing-sig message forthcoming), I think I found a small issue with attrs and the match statement.
To Reproduce
Expected and Actual Behavior
Now we define a function that handles it.
So I'm going to guess it's an issue with how we generate attrs
__match_args__
, maybe for generic types. I might try solving this myself, or it would be awesome if someone more knowledgeable could solve it first.If I use dataclasses it works properly.
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: