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

[WIP] Introduce PEP484 type hints to paulis.py #147

Closed
wants to merge 1 commit into from
Closed

Conversation

rht
Copy link
Contributor

@rht rht commented Oct 15, 2017

Current errors:

  • pyquil/paulis.py:22: error: No library stub file for module 'numpy'
  • pyquil/paulis.py:22: note: (Stub files are from https://github.com/python/typeshed)
  • pyquil/paulis.py:95: error: Argument 1 of "eq" incompatible with supertype "object"
  • pyquil/paulis.py:104: error: Argument 1 of "ne" incompatible with supertype "object"
  • pyquil/paulis.py:181: error: Argument 2 to "term_with_coeff" has incompatible type "complex"; expected "Number"
  • pyquil/paulis.py:181: error: Unsupported operand types for * ("complex" and "Number")
  • pyquil/paulis.py:183: error: Incompatible return value type (got "PauliSum", expected "PauliTerm")
  • pyquil/paulis.py:188: error: Iterable expected
  • pyquil/paulis.py:191: error: Argument 2 to "term_with_coeff" has incompatible type "complex"; expected "Number"
  • pyquil/paulis.py:219: error: Argument 2 to "term_with_coeff" has incompatible type "int"; expected "Number"
  • pyquil/paulis.py:221: error: Unsupported operand types for * ("int" and "PauliTerm")
  • pyquil/paulis.py:221: error: Incompatible types in assignment (expression has type "PauliTerm", variable has type "int")
  • pyquil/paulis.py:223: error: Unsupported operand types for * ("int" and "PauliTerm")
  • pyquil/paulis.py:223: error: Incompatible types in assignment (expression has type "PauliTerm", variable has type "int")
  • pyquil/paulis.py:224: error: Incompatible return value type (got "int", expected "PauliTerm")
  • pyquil/paulis.py:235: error: Argument 1 to "float" has incompatible type "Number"; expected "Union[SupportsFloat, str, bytes]"
  • pyquil/paulis.py:261: error: Incompatible return value type (got "float", expected "PauliSum")
  • pyquil/paulis.py:261: error: Unsupported operand types for + ("PauliTerm" and "float")
  • pyquil/paulis.py:261: error: Unsupported operand types for * ("float" and "Union[PauliTerm, Number]")
  • pyquil/paulis.py:271: error: Unsupported operand types for + ("Union[PauliTerm, Number]" and "PauliTerm")
  • pyquil/paulis.py:271: error: Unsupported operand types for * ("float" and "PauliTerm")
  • pyquil/paulis.py:383: error: No overload variant of "complex" matches argument types [numbers.Number]
  • pyquil/paulis.py:400: error: Unsupported operand types for * ("float" and "PauliTerm")
  • pyquil/paulis.py:404: error: Argument 1 of "eq" incompatible with supertype "object"
  • pyquil/paulis.py:421: error: Argument 1 of "ne" incompatible with supertype "object"
  • pyquil/paulis.py:471: error: List item 0 has incompatible type "Union[PauliTerm, Number]"
  • pyquil/paulis.py:489: error: Unsupported operand types for * ("complex" and "Number")
  • pyquil/paulis.py:506: error: Argument 2 to "term_with_coeff" has incompatible type "int"; expected "Number"
  • pyquil/paulis.py:508: error: Unsupported operand types for * ("int" and "PauliTerm")
  • pyquil/paulis.py:508: error: Incompatible types in assignment (expression has type "PauliTerm", variable has type "int")
  • pyquil/paulis.py:512: error: Unsupported operand types for * ("int" and "PauliTerm")
  • pyquil/paulis.py:512: error: Incompatible types in assignment (expression has type "PauliTerm", variable has type "int")
  • pyquil/paulis.py:515: error: Unsupported operand types for * ("int" and "PauliSum")
  • pyquil/paulis.py:515: error: Incompatible types in assignment (expression has type "PauliSum", variable has type "int")
  • pyquil/paulis.py:516: error: Incompatible return value type (got "int", expected "PauliSum")
  • pyquil/paulis.py:560: error: Incompatible return value type (got "float", expected "PauliSum")
  • pyquil/paulis.py:560: error: Unsupported operand types for + ("PauliSum" and "float")
  • pyquil/paulis.py:560: error: Unsupported operand types for * ("float" and "Union[PauliSum, PauliTerm, Number]")
  • pyquil/paulis.py:572: error: Unsupported operand types for * ("float" and "PauliSum")

@rht
Copy link
Contributor Author

rht commented Oct 15, 2017

Request for help from @neiljp or @gnprice on how to correct these annotation-errors. This is related to python/mypy#3186.

@stevenheidel stevenheidel added the work in progress 🚧 This PR is not ready to be merged. label Oct 16, 2017
@mpharrigan
Copy link
Contributor

Closing due to out-of-date. I also suspect paulis.py is sufficiently messy that it will be difficult to annotate effectively. xref #542

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work in progress 🚧 This PR is not ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants