Derived from the flake8-2020 linter.
What it does#
Checks for uses of
Why is this bad?#
If the current major or minor version consists of multiple digits,
sys.version[:3] will truncate the version number (e.g.,
"3.1"). This is likely unintended, and can lead to subtle bugs if
the version string is used to test against a specific Python version.
sys.version_info to access the current major and minor
version numbers as a tuple, which can be compared to other tuples