gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / pylint / test / functional / mapping_context_py2.py @ 745
History | View | Annotate | Download (411 Bytes)
1 |
# pylint: disable=missing-docstring,invalid-name,too-few-public-methods
|
---|---|
2 |
from __future__ import print_function |
3 |
|
4 |
|
5 |
def test(**kwargs): |
6 |
print(kwargs) |
7 |
|
8 |
# metaclasses as mappings
|
9 |
class Meta(type): |
10 |
def __getitem__(self, key): |
11 |
return ord(key) |
12 |
def keys(self): |
13 |
return ['a', 'b', 'c'] |
14 |
|
15 |
class SomeClass(object): |
16 |
__metaclass__ = Meta |
17 |
|
18 |
test(**SomeClass) |
19 |
test(**SomeClass()) # [not-a-mapping]
|