Remove old Python versions code - #33
Open
Andrej730 wants to merge 6 commits into
Open
Conversation
It was used to add metaclasses, which are supported since Python 3.0
Plugin is regularely tested in CI using versions 6 and 7, so it's not limited to flake8 2 and 3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.Byteshandling - 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 meetStrorBytes, they're always instantiated asConstant.visit_Str,visit_Byteswere still exercised during deprecation period, but it was a workaround in default visitor'svisit_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?