-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Blocker 🙅Blocks the next releaseBlocks the next releaseBug 🪲False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codepython 3.9
Description
Python 3.9 starts to make a great use of __class_getitem__
for exemple in collections.deque.
pylint/checkers/typecheck.py
should probably look for it to infer if something is subscriptable.
Reproducer:
import collections
print(collections.deque[int])
which give:
test.py:11:6: E1136: Value 'collections.deque' is unsubscriptable (unsubscriptable-object)
while the code works thanks to the __class_getitem__
.
Metadata
Metadata
Assignees
Labels
Blocker 🙅Blocks the next releaseBlocks the next releaseBug 🪲False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codepython 3.9