Skip to content

Remove old Python versions code - #33

Open
Andrej730 wants to merge 6 commits into
xZise:masterfrom
Andrej730:drop-old-python-code
Open

Remove old Python versions code#33
Andrej730 wants to merge 6 commits into
xZise:masterfrom
Andrej730:drop-old-python-code

Conversation

@Andrej730

@Andrej730 Andrej730 commented Aug 15, 2026

Copy link
Copy Markdown

Mostly removes idioms used in old Python, but notably removes FMT1XX rules, since they were targeting Python <2.7, where '{}'.format(x) instead of '{0}'.format(x) would raise a runtime error, but since project moved on from Python 2 and currently requires 3.8+, those always result in false positives.

A bit clarification on dropping ast.Str/ast.Bytes handling - they're deprecated in 3.8, which means parser never produces those nodes, they can only be created manually. So in practice in 3.8+ without creating new nodes, it's impossible to meet Str or Bytes, they're always instantiated as Constant.
visit_Str, visit_Bytes were still exercised during deprecation period, but it was a workaround in default visitor's visit_Constant, if it's overridden (as in the case of this plugin), those paths are unreachable.
So it's safe to remove any handling for them.

@xZise can you please take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant