Skip to content

UP036 (outdated-version-block) does not work with slicing #8095

@tdulcet

Description

@tdulcet
import sys

if sys.version_info[:2] < (3, 7):
    print('oh no')

This if block should be removed with --fix, but nothing changes. The Ruff documentation even suggests using this slice syntax here, so this should work as expected. (Maybe a new linter rule could be added to remove this unnecessary slice syntax as well.)

ruff --target-version py37 --select UP036 --isolated test.py
ruff 0.1.1

Originally posted by @tdulcet in #7902 (comment)

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