Replies: 1 comment 1 reply
-
|
I think there's already a request for this rule in #21345! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, currently this Python pattern, if used, leads to unhandled errors - silent failures:
This is because exceptions are only raised when the values are retrieved from the iterator, and here that never happens. A simple fix is to iterate over it, e.g.
_ = list(executor.map(...)).It feels like the result of map() being not assigned at all is the kind of thing that static analysis could catch well? And it feels not unreasonable that intentional use cases of this ("fire-and-forget" maps) could be made to explicitly acknowledge usage of this with a "noqa"?
So... do you think that would this make a useful ruff lint rule?
Thanks,
Tom
Beta Was this translation helpful? Give feedback.
All reactions