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

Spurious no-member pylint errors #86

Closed
rohanpm opened this issue Dec 18, 2018 · 0 comments
Closed

Spurious no-member pylint errors #86

rohanpm opened this issue Dec 18, 2018 · 0 comments

Comments

@rohanpm
Copy link
Owner

rohanpm commented Dec 18, 2018

Currently, code like this:

from more_executors import Executors

with Executors.sync().with_retry() as exc:
    exc.submit(lambda x: x)

Will result in a pylint error like this:

E:  3, 5: Instance of 'SyncExecutor' has no 'with_retry' member (no-member)

In more-executors repo itself, this pylint error was silenced via pylintrc. However, the same problem will affect users of the library.

The code above does not actually have a problem - the issue is that the Executors.wrap() method fools the pylint check.

It would be good to find a way to refactor the code so it has the same meaning but doesn't trigger this pylint error.

rohanpm added a commit that referenced this issue Dec 26, 2018
Drop Executors.wrap method, which is too dynamic for tools such as
pylint to perform type inference. Replace it with a static API
provided by mixins.

Removal of the Executors.wrap method is is a backwards-incompatible
API change.

Fixes #86
bors bot added a commit that referenced this issue Dec 26, 2018
89: Refactor method chaining r=rohanpm a=rohanpm

Drop Executors.wrap method, which is too dynamic for tools such as
pylint to perform type inference. Replace it with a static API
provided by mixins.

Removal of the Executors.wrap method is is a backwards-incompatible
API change.

Fixes #86

Co-authored-by: Rohan McGovern <rohan@mcgovern.id.au>
@bors bors bot closed this as completed in #89 Dec 26, 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

No branches or pull requests

1 participant