summaryrefslogtreecommitdiff
path: root/tests/functional/n/none_dunder_protocols_py36.py
blob: 5573ceeb41fc7592244ef2bb671fc55a5b1e49e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# pylint: disable=missing-docstring, too-few-public-methods,pointless-statement
# pylint: disable=expression-not-assigned

class MetaIterable(type):
    __iter__ = None


class MetaOldIterable(type):
    __getitem__ = None


class MetaContainer(type):
    __contains__ = None


class NonIterableClass(metaclass=MetaOldIterable):
    __contains__ = None


class OldNonIterableClass(metaclass=MetaOldIterable):
    __contains__ = None


class NonContainerClass(metaclass=MetaContainer):
    __iter__ = None


def test():
    1 in NonIterableClass  # [unsupported-membership-test]
    1 in OldNonIterableClass  # [unsupported-membership-test]
    1 in NonContainerClass # [unsupported-membership-test]
    1 in NonIterableClass()  # [unsupported-membership-test]
    1 in OldNonIterableClass()  # [unsupported-membership-test]
    1 in NonContainerClass()  # [unsupported-membership-test]