-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consider-using-f-string
should not be issued with py-version < 3.6
#5019
Comments
pylint shouldn't be issuing this in Python < 3.6 mode. Refs pylint-dev/pylint#5019
Hmm, I don't think pylint is supposed to be able to analyze version < 3.6. The py-version is kinda misleading because it feels like it should work but there was clearly an assumption that python interpreter used == py-version, originally. What do you think @cdce8p ? |
Hm, not sure what you mean by that assumption. But FWIW the way it's put in the release notes:
...gives a very strong impression that it actually does work. In my opinion it definitely should :) BTW the features entry for this option at https://docs.pylint.org/en/latest/technical_reference/features.html?highlight=py-version#general-options is quite confusing:
It first says default is the version used to run pylint, then it says default is 3.8. |
That was my initial though as well. However, it does make sense to extend it to other checks. If I remember correctly we discussed that shortly that users might want this setting to work for other checks as well. I haven't though about FYI: At the moment,
I agree. That should have been put better into context.
The docs are autogenerated with Python 3.8. A bit unfortunate if I'm being honest
Thanks for the suggestion! A PR would be welcome. |
Opened #5024 that should address the main concern with the |
pylint-dev/pylint#5019 was addressed in pylint 2.12.0, we're past that now.
Bug description
f-strings were introduced in Python 3.6, they should not be recommended with earlier py-versions.
Configuration
No response
Command used
Pylint output
Expected behavior
No
consider-using-f-string
message whenpy-version
is set to earlier than 3.6.Pylint version
OS / Environment
No response
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: