-
-
Notifications
You must be signed in to change notification settings - Fork 273
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 misc type issues #1884
Fix misc type issues #1884
Conversation
astroid/nodes/scoped_nodes/mixin.py
Outdated
@@ -109,7 +109,7 @@ def _append_node(self, child: nodes.NodeNG) -> None: | |||
# which uses the current class as a mixin or base class. | |||
# It's rewritten in 2.0, so it makes no sense for now | |||
# to spend development time on it. | |||
self.body.append(child) | |||
self.body.append(child) # type: ignore |
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.
Some dynamic trickery happening here. From comment: # pylint: disable=no-member; depending by the class
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 should at least ignore a specific warning instead of the broader ignore.
@@ -75,5 +75,5 @@ def brainless_manager(): | |||
m.astroid_cache = {} | |||
m._mod_file_cache = {} | |||
m._transform = transforms.TransformVisitor() | |||
m.extension_package_whitelist = {} | |||
m.extension_package_whitelist = set() |
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.
Straightforward type error
Pull Request Test Coverage Report for Build 3526908840
π - Coveralls |
@@ -636,13 +636,14 @@ def _infer_old_style_string_formatting( | |||
TODO: Instead of returning Uninferable we should rely | |||
on the call to '%' to see if the result is actually uninferable. | |||
""" | |||
values = None |
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.
Rather than assign and then reassign with a different type, just make sure the variable gets defined in all branches
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.
LGTM, thank you @nickdrozd !
astroid/nodes/scoped_nodes/mixin.py
Outdated
@@ -109,7 +109,7 @@ def _append_node(self, child: nodes.NodeNG) -> None: | |||
# which uses the current class as a mixin or base class. | |||
# It's rewritten in 2.0, so it makes no sense for now | |||
# to spend development time on it. | |||
self.body.append(child) | |||
self.body.append(child) # type: ignore |
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 should at least ignore a specific warning instead of the broader ignore.
Description
Address some minor Mypy complaints.
Type of Changes