-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
3.14 annotation evaluation is deferred #10149
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
Comments
Also |
Python 3.14 is now in beta. The new annotation behavior is handled correctly by Mypy and Ruff. |
Do you want to contribute Nick ? Now that the beta is out and available in github actions, there's pylint-dev/astroid#2731 on the astroid side but you can already work on the pylint side even if astroid is not officially 3.14 ready yet :) We do not work on new features during alphas because we already did in the past and then had to revert some of the things we did before the beta was released. ruff is supported by astral and mypy is supported by dropbox so they can probably afford to make different choices. pylint maintenance is volunteer based (except for CVE, supported by Tidelift), so if no one is intrinsically motivated to do something nothing happen. |
No, it seems like it will be a lot of work. I am happy to help with PR review though. Probably it is going to require a complete overhaul of the variables checker. I think it would be a good idea to fix this issue and #9815 and other variable false positives (walrus, etc) all at once. |
I think the patch is just: diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py
index 32ec31809..e8d12eebb 100644
--- a/pylint/checkers/variables.py
+++ b/pylint/checkers/variables.py
@@ -1363,7 +1363,11 @@ class VariablesChecker(BaseChecker):
checks globals doesn't overrides builtins.
"""
self._to_consume = [NamesConsumer(node, "module")]
- self._postponed_evaluation_enabled = is_postponed_evaluation_enabled(node)
+ py_version = self.linter.config.py_version
+ py314_plus = py_version >= (3, 14)
+ self._postponed_evaluation_enabled = (
+ py314_plus or is_postponed_evaluation_enabled(node)
+ )
for name, stmts in node.locals.items():
if utils.is_builtin(name): |
@jacobtylerwalls Yeah, mostly. Updating a lot of test cases as well though. I've startet to look into it. Will open a PR for it in the next few days. |
Bug description
Configuration
Command used
Pylint output
Expected behavior
no warning
Pylint version
OS / Environment
No response
Additional dependencies
The text was updated successfully, but these errors were encountered: