A Guide to Python’s Magic Methods « rafekettler.com
__index__(self)
Implements type conversion to an int when the object is used in a slice expression. If you define a custom numeric type that might be used in slicing, you should define __index__
A Guide to Python’s Magic Methods « rafekettler.com
__index__(self)
Implements type conversion to an int when the object is used in a slice expression. If you define a custom numeric type that might be used in slicing, you should define __index__