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 default
The 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
Summary
The following code throws a false-positive:
The 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