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

[flake8-pyi] Remove type parameter correctly when it is the last (PYI019) #15854

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

InSyncWithFoo
Copy link
Contributor

Summary

Part of #15821.

Prior to this change, a PEP 695 type variable would not be removed correctly were it to be placed at the very end of the type parameter list:

# Original
def f[T, S](self: S) -> S: ...

# Before
def f[TS](self) -> Self: ...

# After
def f[T](self) -> Self: ...

Test Plan

cargo nextest run and cargo insta test.

Copy link
Member

@AlexWaygood AlexWaygood 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!

@AlexWaygood AlexWaygood added bug Something isn't working fixes Related to suggested fixes for violations preview Related to preview mode features labels Jan 31, 2025
@AlexWaygood AlexWaygood merged commit b2cb757 into astral-sh:main Jan 31, 2025
21 checks passed
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixes Related to suggested fixes for violations preview Related to preview mode features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants