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

Use PEP-673 Self type annotations #6057

Merged
merged 2 commits into from
Apr 13, 2023
Merged

Use PEP-673 Self type annotations #6057

merged 2 commits into from
Apr 13, 2023

Conversation

maffoo
Copy link
Contributor

@maffoo maffoo commented Apr 12, 2023

As described in PEP-673, the Self type can be used for methods that return the same type of self, even when used in subclasses. This replaces explicit annotations with typevars like TSelf.

@CirqBot CirqBot added the size: L 250< lines changed <1000 label Apr 12, 2023
@maffoo maffoo mentioned this pull request Apr 12, 2023
@maffoo maffoo force-pushed the u/maffoo/self-type branch 2 times, most recently from 9387a1e to 2e6549b Compare April 13, 2023 05:06
@maffoo maffoo changed the title Update to latest mypy and use Self type annotations Use PEP-673 Self type annotations Apr 13, 2023
@maffoo maffoo force-pushed the u/maffoo/self-type branch from 2e6549b to 78122f9 Compare April 13, 2023 05:26
@maffoo maffoo marked this pull request as ready for review April 13, 2023 05:42
@maffoo maffoo requested review from wcourtney, a team, vtomole, cduck and verult as code owners April 13, 2023 05:42
@maffoo maffoo enabled auto-merge (squash) April 13, 2023 21:08
@maffoo maffoo merged commit 5c2bcda into master Apr 13, 2023
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
@pavoljuhas pavoljuhas deleted the u/maffoo/self-type branch January 22, 2025 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: L 250< lines changed <1000
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants