achevrot / impunity

A Python library to check physical units
https://achevrot.github.io/impunity/
MIT License
10 stars 0 forks source link

Annotated Assignment when the value of the node is iterable #2

Closed achevrot closed 1 year ago

achevrot commented 1 year ago
alt_m1: "m" = 1000
alt_m2: "m" = 1000
alt_m3: "m" = 1000
l: "m" = [alt_m1, alt_m2, alt_m3]
self.assertEqual(l[0], 1000)
l2: "ft" = [alt_m1, alt_m2, alt_m3]
self.assertAlmostEqual(l2[0], 3280.84, delta=1e-2)

First test is fine but second one fails : can't multiply sequence by non-int of type 'float'

Would need to change the Annotated Assign node visitor implementation to do so.