Reproducible but incorrect Pylint: E1133:not-an-iterable in library

See this discussion. TLDR:

In this library all overloads of a method query return an instance of DOMQuery:

and DOMQuery implements __iter__:

But using DOMQuery in list comprehension reliably causes Pylint: E1133:not-an-iterable.

I traced it down to InferenceError being raised deep in astroid internals, but I don’t understand why.
Help welcome!

Sounds like this might be a question for the Pylint maintainers?

1 Like

Hello Dave,

pylint maintainer here. It seems the issue require investigation and can’t be answered swiftly (it seems you already investigated yourself and identified an issue in astroid). For question about pylint the best/official place is pylint’s bug-tracker here: Issues · pylint-dev/pylint · GitHub. Would you mind opening an issue so your question is tracked ?

1 Like

Thanks, thought about it but didn’t want to pollute issues :grin:
Done! Reproducible but incorrect Pylint: E1133:not-an-iterable in library · Issue #9253 · pylint-dev/pylint · GitHub