diff options
Diffstat (limited to 'tests/functional/mapping_context_py2.py')
-rw-r--r-- | tests/functional/mapping_context_py2.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/functional/mapping_context_py2.py b/tests/functional/mapping_context_py2.py new file mode 100644 index 000000000..f5cdc753d --- /dev/null +++ b/tests/functional/mapping_context_py2.py @@ -0,0 +1,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] |