MCPcopy Index your code
hub / github.com/RustPython/RustPython / SimpleNameSpace

Class SimpleNameSpace

Lib/test/test_dataclasses/__init__.py:2110–2120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2108 def test_field_metadata_custom_mapping(self):
2109 # Try a custom mapping.
2110 class SimpleNameSpace:
2111 def __init__(self, **kw):
2112 self.__dict__.update(kw)
2113
2114 def __getitem__(self, item):
2115 if item == 'xyzzy':
2116 return 'plugh'
2117 return getattr(self, item)
2118
2119 def __len__(self):
2120 return self.__dict__.__len__()
2121
2122 @dataclass
2123 class C:

Callers 1

CClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected