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

lint: ignore class self annotations #8492

Merged
merged 2 commits into from
Nov 11, 2022

Conversation

davidcavazos
Copy link
Contributor

Description

Ignore self annotations for class methods. Typing them require typing-extensions to use the Self type, which is redundant and does not provide new information. Otherwise, the class name is not available when defining methods since it hasn't finished defining, so it requires further hacks to annotate.

Furthermore, PEP 673 has made self type annotations unnecessary, but is only available on Python 3.11+.

Checklist

@davidcavazos davidcavazos requested a review from a team as a code owner November 10, 2022 21:36
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Nov 10, 2022
@davidcavazos davidcavazos added blunderbuss: assign Instruct blunderbuss to assign someone and removed samples Issues that are directly related to samples. labels Nov 10, 2022
@blunderbuss-gcf blunderbuss-gcf bot removed the blunderbuss: assign Instruct blunderbuss to assign someone label Nov 10, 2022
Copy link
Collaborator

@dandhlee dandhlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This is great to have, I agree that it is redundant and extremely unnecessary. This can definitely be an optional addition if folks choose to use it, otherwise it should be ignored.

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Nov 11, 2022
Copy link
Collaborator

@leahecole leahecole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch

@leahecole leahecole added the automerge Merge the pull request once unit tests and other checks pass. label Nov 11, 2022
@gcf-merge-on-green gcf-merge-on-green bot merged commit 0f86323 into main Nov 11, 2022
@gcf-merge-on-green gcf-merge-on-green bot deleted the lint-ignore-self-annotations branch November 11, 2022 17:10
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants