Skip to content

Conversation

andrewgsavage
Copy link
Contributor

with this branch https://github.com/quantity-dev/pint/tree/metrology that adds Quantity.value to pint's Quantity, mypy runs without errors (and errors if I try to access Quantity.m)

are there any examples on good ways to organise this code?

@andrewgsavage
Copy link
Contributor Author

I'm getting this error

  f:\A\repos\metrology-apis\test_pint.py:46:11 - error: Argument of type "PlainQuantity[int, PlainUnit]" cannot be assigned to parameter "q" of type "Quantity[Unknown, Unknown]" in function "test_unit"
    "PlainQuantity[int, PlainUnit]" is incompatible with protocol "Quantity[Unknown, Unknown]"
      "Quantity[V@Quantity, U@Quantity]" is not assignable to "PlainQuantity[int, PlainUnit]"
      "Quantity[V@Quantity, U@Quantity]" is not assignable to "PlainQuantity[int, PlainUnit]"
      Could not bind method "__eq__" because "PlainQuantity[int, PlainUnit]" is not assignable to parameter "self"
        "PlainQuantity[int, PlainUnit]" is incompatible with protocol "Quantity[V@Quantity, U@Quantity]"
          "Quantity[V@Quantity, U@Quantity]" is not assignable to "PlainQuantity[int, PlainUnit]"
          "Quantity[V@Quantity, U@Quantity]" is not assignable to "PlainQuantity[int, PlainUnit]"
          "__eq__" is an incompatible type
    ... (reportArgumentType)

Any ideas how to deal with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant