paleolimbot commented on code in PR #396:
URL: https://github.com/apache/arrow-nanoarrow/pull/396#discussion_r1520689687
##########
python/src/nanoarrow/_lib.pyx:
##########
@@ -1066,10 +1068,15 @@ cdef class CArray:
return out
def __getitem__(self, k):
+ self._assert_valid()
+
+ cdef int64_t kint
+
if not isinstance(k, slice):
- raise TypeError(
- f"Can't slice CArray with object of type {type(k).__name__}"
- )
+ kint = k
+ if kint < 0:
+ kint += self._ptr.length
+ return CScalar(self, kint)
Review Comment:
Good call! The CScalar is no more!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]