Commit 6fc8419 1 parent 3fb63f7 commit 6fc8419 Copy full SHA for 6fc8419
File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -2216,13 +2216,13 @@ def __getitem__(
2216
2216
cls = type (self )
2217
2217
return cls (indices .__len__ , lambda idx : self [indices [idx ]])
2218
2218
if not isinstance (index , int ):
2219
- raise TypeError ("sequence indices must be integers" )
2219
+ raise TypeError ("sequence indices must be integers" ) from TypeError ( f"index = { index } " )
2220
2220
len_self = len (self )
2221
2221
if index < 0 :
2222
2222
# support negative indexes
2223
2223
index = len_self + index
2224
2224
if index < 0 or index >= len_self :
2225
- raise IndexError ("sequence index out of range" )
2225
+ raise IndexError ("sequence index out of range" ) from IndexError ( f"size = { len_self } , index: { index } " )
2226
2226
return self .get_function (index )
2227
2227
2228
2228
def __delitem__ (self , index : Union [int , slice ]) -> None :
You can’t perform that action at this time.
0 commit comments