Skip to content

bad-version-info-comparison (PYI006) doesn't run in .py files #13836

@Avasam

Description

@Avasam

This rule could've caught an issue in pywin32 (mhammond/pywin32#2416). I think it's a valid rule to enforce on runtime files to prevent incorrect expectations.

MRE:

if sys.version_info > (3, 10):  # PYI006 only shows here in .pyi files
    print("Do something on Python 3.11")

Command: ruff check --select=PYI
Version: ruff 0.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedReady for implementationhelp wantedContributions especially welcomeruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions