Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pint test #12

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

andrewgsavage
Copy link

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
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