pylint-dev/pylint

pylint 3.2.0 causes false-positive E1133 (not-an-iterable) error in packages with .pyi stubs

ZivRonen opened this issue ยท 6 comments

Bug description

"""Show pylint not-an-iterable issue with more-itertools. Pylint: 3.2.0, more-itertools: 1.20.0"""
import more_itertools

for val in more_itertools.chunked([1, 2, 3], n=1):
    print(val)

Configuration

No response

Command used

pylint test.py

Pylint output

************* Module test
test.py:4:11: E1133: Non-iterable value more_itertools.chunked([1, 2, 3], n=1) is used in an iterating context (not-an-iterable)

------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)

Expected behavior


Your code has been rated at 10.00/10 (previous run: 0.00/10, +10.00)

Pylint version

pylint 3.2.0
astroid 3.2.0
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux

OS / Environment

No response

Additional dependencies

more-itertools==1.20.0

Thanks for the report. Caused in pylint-dev/astroid#2375, which we may need to revert.

Planning to get patch releases of astroid and pylint out in the next few days. This should have been guarded under an experimental feature flag.

Ok, thank you very much ๐Ÿ‘
Is it grouped under another issue? Should I close this one?

Let's leave it open so that it's discoverable until we get the patches out.

Fixed by astroid version 3.2.1

If you have pylint 3.2.0 you need to upgrade astroid (pip install astroid -U) or wait for pylint 3.2.1 to be released.