summaryrefslogtreecommitdiff
path: root/pylint/test/functional/mapping_context_py2.py
blob: afe4400e34c9d01e07431842f23818af77a2afd3 (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
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]