blob: f5cdc753d3dcb83f003a5b806c7ba41437df9faa (
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, useless-object-inheritance
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]
|