-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
Fix brain dict regression #2204
Fix brain dict regression #2204
Conversation
5da1e42
to
b23d74e
Compare
Put back as draft as this apparently breaks tests. |
@jacobtylerwalls I tried to implement your suggestion but with that I apparently run into other test failures. I could get pylint working again with: --- a/astroid/manager.py
+++ b/astroid/manager.py
@@ -66,6 +66,7 @@ class AstroidManager:
def __init__(self) -> None:
# NOTE: cache entries are added by the [re]builder
+ self.__dict__ = AstroidManager.brain
self.astroid_cache = AstroidManager.brain["astroid_cache"]
self._mod_file_cache = AstroidManager.brain["_mod_file_cache"]
self._failed_import_hooks = AstroidManager.brain["_failed_import_hooks"] At the moment I'm stuck as I don't know enough about astroid to continue here. |
Interesting. What happens if you revert the changes relating to the mutable values like |
0d68276
to
1b3452a
Compare
4bc4d37
to
9fb673e
Compare
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.
Thanks for identifying the issue and sending a patch. Welcome aboard!
9fb673e
to
5ddfecd
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2204 +/- ##
==========================================
+ Coverage 92.53% 92.68% +0.15%
==========================================
Files 94 94
Lines 10818 10830 +12
==========================================
+ Hits 10010 10038 +28
+ Misses 808 792 -16
Flags with carried forward coverage won't be shown. Click here to find out more.
|
5ddfecd
to
167be8e
Compare
cc2ccfb
to
6ad6d2e
Compare
We get rid of the immutable instance attributes in AstroidManager, ensuring that these always mutate the global state instead of instance's. This fixes a regression introduced in commit bbcc58b. Fixes pylint-dev#2200
6ad6d2e
to
5effdf8
Compare
@jacobtylerwalls Do you want to add typing to these signatures? |
Nah, doesn't need to be done now. Doesn't provide much value anyway. |
The missing coverage is worth adding, though! |
for more information, see https://pre-commit.ci
Fix regression resulting in ignored pylint settings We get rid of the immutable instance attributes in AstroidManager, ensuring that these always mutate the global state instead of instance's. This fixes a regression introduced in commit bbcc58b. Fixes #2200 (cherry picked from commit b08166b) Co-authored-by: Josef Kemetmüller <josef.kemetmueller@gmail.com>
Thank you! |
Type of Changes
This fixes issue #2200, which should fix pylint-dev/pylint#7433.
Description
Closes #2200