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

Class IntLike

Lib/test/test_itertools.py:1187–1191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1185 # Issue #30537: islice can accept integer-like objects as
1186 # arguments
1187 class IntLike(object):
1188 def __init__(self, val):
1189 self.val = val
1190 def __index__(self):
1191 return self.val
1192 self.assertEqual(list(islice(range(100), IntLike(10))), list(range(10)))
1193 self.assertEqual(list(islice(range(100), IntLike(10), IntLike(50))),
1194 list(range(10, 50)))

Callers 1

test_isliceMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_isliceMethod · 0.56