-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
False unsubscriptable-object positive with generic subprocess.Popen and python3.9 #4034
False unsubscriptable-object positive with generic subprocess.Popen and python3.9 #4034
Comments
…thon 3.9 This is necessary for pylint to detect that `subprocess.Popen` is subscriptable, starting from Python 3.9 (see pylint-dev/pylint#4034). $ python3.9 >>> import subprocess >>> subprocess.Popen.__class_getitem__ <bound method GenericAlias of <class 'subprocess.Popen'>>
tl;dr: on Python 3.8 and earlier, everything seems fine, I don't think there is a bug. With Python 3.9, though, this is a bug and a fix has been proposed in Astroid (a dependency of pylint): pylint-dev/astroid/pull/882. Maintainers: I would mention "under Python 3.9" in the title and add the corresponding issue tag. :) On Python 3.8 and earlier
So I think that pylint is right to report an error here up to Python 3.8. On Python 3.9However, under Python 3.9, So, with Python 3.9, pylint should not report the To determine whether a class is subscriptable, pylint looks for a I proposed a fix in Astroid: pylint-dev/astroid/pull/882. |
…thon 3.9 This is necessary for pylint to detect that `subprocess.Popen` is subscriptable, starting from Python 3.9 (see pylint-dev/pylint#4034). $ python3.9 >>> import subprocess >>> subprocess.Popen.__class_getitem__ <bound method GenericAlias of <class 'subprocess.Popen'>>
Oh, interesting. The error was provoked by a fix to an issue flagged by running mypy with python 3.8 in python_version 3.8 mode. I think that makes it a mypy (well or typeshed) bug, too. Thanks! |
Steps to reproduce
Current behavior
Expected behavior
No
unsubscriptable-object
error.pylint --version output
The text was updated successfully, but these errors were encountered: