blob: c7b06cfb2eddeaf44f95aff71571273c5645c887 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
"""
Checks that class used in a subscript supports subscription
(i.e. defines __class_getitem__ method).
"""
# pylint: disable=missing-docstring,pointless-statement,expression-not-assigned,wrong-import-position
# pylint: disable=too-few-public-methods,import-error,invalid-name,wrong-import-order, useless-object-inheritance
import typing
class Subscriptable(object):
def __class_getitem__(cls, params):
pass
Subscriptable[0]
Subscriptable()[0] # [unsubscriptable-object]
a: typing.List[int]
|