Skip to content

Slightly refactor float_factory (for mypy) #315

Open
@Funth0mas

Description

@Funth0mas

So that we can setup mypy on CI we need to elliminate all errors. Currently all serious mypy errors are in canmatrix.canmatrix and most of them are bound to float_factory playing with attrs.

The problem is, that mypy currently only undertsand attr converters, if they are named functions. That means NEITHER converter=decimal.Decimal NOR converter=CanId.from_compound_integer.

Hopefully we could add named 'helper' function (say convert_to_float(x: Any) -> Any)to satisfy mypy, but the question is - do every Signal needs its own converter? Wouldn't be single module-level converter enough?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions