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):
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?
Activity
sobolevn commentedon Oct 4, 2022
Not directly related, but check out our
Someimplementation: https://returns.readthedocs.io/en/latest/pages/maybe.htmlmgedmin commentedon Nov 9, 2024
I think I stumbled upon this bug too. Given
now
versus
brianschubert commentedon Nov 9, 2024
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?