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 will select the first digit of the major version number
"3.10" would evaluate to
"1"). This is likely unintended,
and can lead to subtle bugs if the version string is used to test against a
major version number.
sys.version_info.major to access the current major version