summaryrefslogtreecommitdiff
path: root/pylint/test/functional/mapping_context_py2.py
blob: 765314dc078b82f7656c59fac0edeb7e682ddc24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# pylint: disable=missing-docstring,invalid-name,too-few-public-methods,no-self-use,bad-mcs-method-argument
from __future__ import print_function


def test(**kwargs):
    print(kwargs)

# metaclasses as mappings
class Meta(type):
    def __getitem__(self, key):
        return ord(key)
    def keys(self):
        return ['a', 'b', 'c']

class SomeClass(object):
    __metaclass__ = Meta

test(**SomeClass)
test(**SomeClass())  # [not-a-mapping]