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

Class MyMapping

Lib/test/test_collections.py:1847–1853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1845 self.assertIsSubclass(sample, Mapping)
1846 self.validate_abstract_methods(Mapping, '__iter__', '__len__', '__getitem__')
1847 class MyMapping(Mapping):
1848 def __len__(self):
1849 return 0
1850 def __getitem__(self, i):
1851 raise IndexError
1852 def __iter__(self):
1853 return iter(())
1854 self.validate_comparison(MyMapping())
1855 self.assertRaises(TypeError, reversed, MyMapping())
1856

Callers 1

test_MappingMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_MappingMethod · 0.56