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

Replace type_workarounds.NotImplementedType #6775

Closed
pavoljuhas opened this issue Oct 16, 2024 · 3 comments · Fixed by #6790
Closed

Replace type_workarounds.NotImplementedType #6775

pavoljuhas opened this issue Oct 16, 2024 · 3 comments · Fixed by #6790
Assignees
Labels
good first issue This issue can be resolved by someone who is not familiar with the codebase. A good starting issue. kind/deprecation kind/health For CI/testing/release process/refactoring/technical debt items no QC knowledge needed Want to contribute to Cirq, but don't know quantum computing? This issue is for you. triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add

Comments

@pavoljuhas
Copy link
Collaborator

pavoljuhas commented Oct 16, 2024

Description of the issue

Python 3.10 (our minimum requirement) provides types.NotImplementedType. The following workaround is redundant and can be replaced with that type -

"""Workarounds for deficiencies in python's typing system."""
from typing import Any
# At the moment there's no reliable way to say 'NotImplementedType'.
# - type(NotImplemented) causes mypy to error.
# - Just NotImplemented causes runtime errors (it's not a type).
# - The string "NotImplemented" causes runtime errors (in some python versions).
NotImplementedType = Any

TODO

  • switch to types.NotImplementedType in the code
  • delete the type_workarounds module

Cirq version

1.5.0.dev at 351a08e.

@pavoljuhas pavoljuhas added kind/health For CI/testing/release process/refactoring/technical debt items good first issue This issue can be resolved by someone who is not familiar with the codebase. A good starting issue. no QC knowledge needed Want to contribute to Cirq, but don't know quantum computing? This issue is for you. kind/deprecation labels Oct 16, 2024
@NoureldinYosri NoureldinYosri added the triage/discuss Needs decision / discussion, bring these up during Cirq Cynque label Oct 30, 2024
@senecameeks senecameeks added triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add and removed triage/discuss Needs decision / discussion, bring these up during Cirq Cynque labels Oct 30, 2024
@senecameeks
Copy link
Collaborator

Cirq Cynq: good first issue, no QC experience required.

@Ayobami-00
Copy link
Contributor

Hi @senecameeks .

I'd like to work on this issue. Could you please assign it to me?

@Ayobami-00
Copy link
Contributor

Hi @senecameeks , I made PR for this.

Kindly take a look.

#6790

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue This issue can be resolved by someone who is not familiar with the codebase. A good starting issue. kind/deprecation kind/health For CI/testing/release process/refactoring/technical debt items no QC knowledge needed Want to contribute to Cirq, but don't know quantum computing? This issue is for you. triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants