Skip to content

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 a team, cduck, verult, vtomole and wcourtney 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.

4 participants