-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Handle assert_never() when imported from typing_extensions #9782
Conversation
This comment has been minimized.
This comment has been minimized.
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## main #9782 +/- ##
=======================================
Coverage 95.81% 95.81%
=======================================
Files 174 174
Lines 18860 18860
=======================================
+ Hits 18070 18071 +1
+ Misses 790 789 -1
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ΓlΓ©gant fix, I like when we remove complexity and fix bugs at the same time it's surprisingly often happening too. Just a nit.
|
||
from pylint.constants import PY311_PLUS | ||
|
||
if PY311_PLUS: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use sys.version_info directly here. Importing from pylint create coupling so more maintenance work when we drop python 3.11 and more importantely code in the wild will never import out internal constants so it makes functional tests less likely to be representative of real code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it Less maintenance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll have to modify this when we drop python 3.11 and the constant does not exists anymore, right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I was suggesting it was the same whether we use the constant or the version guard. The last times we dropped versions we also removed version guards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a functional test, I don't think functional test should look like internal pylint code. However it's not really important, let's move on
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit 3ace500 |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-maintenance/3.2.x maintenance/3.2.x
# Navigate to the new working tree
cd .worktrees/backport-maintenance/3.2.x
# Create a new branch
git switch --create backport-9782-to-maintenance/3.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a48cd4c6a872b6565bc58030b74585812f327f36
# Push it to GitHub
git push --set-upstream origin backport-9782-to-maintenance/3.2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-maintenance/3.2.x Then, create a pull request where the |
Type of Changes
Description
Closes #9780