Skip to content

PYI026 autofixes ignoring target_version, not importing from typing_extensions #6695

@Skylion007

Description

@Skylion007

PYI026s autofix is broken. It addes TypeAlias annotations everywhere, but unconditionally imports from typing when it should import from typing_extensions if the target_version is less than py310. The bug appears to present when the PR was initially introduced in #5844

https://beta.ruff.rs/docs/rules/type-alias-without-annotation/

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions