achevrot / impunity

A Python library to check physical units

Home Page:https://achevrot.github.io/impunity/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Annotated Assignment when the value of the node is iterable

achevrot opened this issue · comments

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.