-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
Steps to reproduce
Run pylint on the following code:
from typing import Dict
class Translator(Dict[str, str]):
pass
t = Translator(beep='hello', bloop='world')
print(t['beep'], t['bloop'])Current behavior
pylint reports:
E1136: Value 't' is unsubscriptable (unsubscriptable-object)
E1136: Value 't' is unsubscriptable (unsubscriptable-object)
Expected behavior
No message is reported, since t acts just like a dict.
pylint --version output
pylint 2.4.0
astroid 2.3.0
Python 3.7.2 (default, Feb 26 2019, 13:02:33)
[GCC 7.3.1 20180323 [gcc-7-branch revision 258812]]
Note
While superficially similar, this is different from #2849 since there the problem is in subscripting the type, while here subscripting the type is accepted but subscripting the instance is not.
geniass, d1618033, ZeeD, attilaolah, jashburn8020 and 3 more