Skip to content

Comments

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

Merged
AlexWaygood merged 1 commit intoastral-sh:mainfrom
InSyncWithFoo:PYI019-2
Jan 31, 2025
Merged

[flake8-pyi] Remove type parameter correctly when it is the last (PYI019)#15854
AlexWaygood merged 1 commit intoastral-sh:mainfrom
InSyncWithFoo:PYI019-2

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
@github-actions
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