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

Class CustomIndex

extra_tests/snippets/builtin_slice.py:158–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156
157
158class CustomIndex:
159 def __init__(self, x):
160 self.x = x
161
162 def __index__(self):
163 return self.x
164
165
166assert c[CustomIndex(1) : CustomIndex(3)] == [1, 2]

Callers 1

builtin_slice.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected