False unsubscriptable-object positive with generic subprocess.Popen and __future__ annotations #4369
Labels
C: unsubscriptable-object
Issues related to 'unsubscriptable-object' check
False Positive 🦟
A message is emitted but nothing is wrong with the code
typing
Milestone
A variant of #4034, just with annotations imported on python 3.8. Per that issue, outputting the error is arguably correct if the
from __future__ import annotations
import is not present, but when it is, this should not result in an error.I'm guessing (not tested) just adding
subprocess.Popen
topylint.checkers.utils.SUBSCRIPTABLE_CLASSES_PEP585
would be a quick and dirty fix, butsubprocess.Popen
isn't actually mentioned in PEP 585 so it wouldn't feel quite right.There might be some others similarly affected, mypy docs at https://mypy.readthedocs.io/en/stable/runtime_troubles.html#using-classes-that-are-generic-in-stubs-but-not-at-runtime mention
os.PathLike
andqueue.Queue
.Steps to reproduce
Current behavior
Expected behavior
No unsubscriptable-object
pylint --version output
Result of
pylint --version
output:The text was updated successfully, but these errors were encountered: