-
Notifications
You must be signed in to change notification settings - Fork 226
Open
astral-sh/ruff
#23088Labels
dataclassesIssues relating to dataclasses and dataclass_transformIssues relating to dataclasses and dataclass_transform
Milestone
Description
Summary
The following code throws a false-positive:
from attrs import define, field
@define
class C:
x: float = field(converter=float)
C("1")error[invalid-argument-type]: Argument is incorrect
--> baybe/ty.py:9:3
|
9 | C("1")
| ^^^ Expected `int | float`, found `Literal["1"]`
|
info: rule `invalid-argument-type` is enabled by defaultThe issue is that attrs converters don't seem to be supported yet, which are handled via the attrs plugin in mypy. I'm aware that there is already a PR to enable dataclass support (#111) but since converters are not available via dataclasses, I think this is probably a separate issue.
Version
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dataclassesIssues relating to dataclasses and dataclass_transformIssues relating to dataclasses and dataclass_transform