Skip to content

false positive syntax errors when using syntax for newer python version in .pyi files #21677

@DetachHead

Description

@DetachHead

Summary

# foo.pyi

def foo[T](): ...

type Foo = int
Cannot use type parameter lists on Python 3.8 (syntax was added in Python 3.12)
Cannot use `type` alias statement on Python 3.8 (syntax was added in Python 3.12)

since .pyi files are not executed at runtime, they should be able to use newer syntax than the target python version

Version

0.14.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-decisionAwaiting a decision from a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions