Skip to content
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

Suppress false-positive not-callable messages from class descriptors #1911

Merged
merged 1 commit into from
Mar 16, 2018

Conversation

brycepg
Copy link
Contributor

@brycepg brycepg commented Mar 5, 2018

This is a holdover until astroid can be fixed. Astroid needs to
understand descriptors or at least raise Uninferable instead
of allowing the descriptor instance through

Close #1699

@coveralls
Copy link

coveralls commented Mar 5, 2018

Coverage Status

Coverage remained the same at 89.081% when pulling b2cf480 on brycepg:gb into 9dd978a on PyCQA:master.

@@ -229,3 +229,19 @@ def test_typing_namedtuple_unsubscriptable_object_issue1295(self):
subscript = module.body[-1].value
with self.assertNoMessages():
self.checker.visit_subscript(subscript)

def test_staticmethod_multiprocessing_call(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add a test with a user-defined descriptor?

Copy link
Contributor Author

@brycepg brycepg Mar 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually cannot repro elsewhere. descriptors become Uninferable anywhere else due to (https://github.com/PyCQA/astroid/blob/master/astroid/scoped_nodes.py#L2333). Somehow the multiprocessing staticmethod descriptor is getting through with all the magic going on (use of globals, inheritance, all, etc in multiprocessing)

This is a holdover until astroid can be fixed. Astroid needs to
understand descriptors or at least raise Uninferable instead
of allowing the descriptor instance through

Close pylint-dev#1699
@PCManticore
Copy link
Contributor

Thanks Bryce!

@PCManticore PCManticore merged commit 12e4808 into pylint-dev:master Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive "not-callable" for "multiprocessing.current_process"
3 participants