@aatle on PixelArray in #3889 (comment)
I agree with the observations.
After inspecting the code and stubs, I see multiple issues with the original code.
See _pxarray_subscript and _pxarray_ass_subscript in pixelarray.c, and see pixelarray.pyi.
- (typing only: bug) Missing
__getitem__ overloads for two-element tuples other than tuple[int, int], as well as one-element tuples
- (mentioned issue: API) Should not return
None from __getitem__ with empty slice (not how slicing should work)
- (API/bug)
__getitem__ with single ellipsis argument returns self reference instead of new copy
- (API/bug?)
None is intended to be same as ellipsis, but None alone cannot be used as index for __getitem__ or __setitem__
- (typing only: improvement) Both 1D and 2D
PixelArrays currently share the same signatures for type checking, which is a mess
- (bug) Both
__getitem__ and __setitem__ for both 1D and 2D mostly fail to gracefully handle an index that is a one-element tuple (e.g. pxarray[("hello",)])
@aatle on PixelArray in #3889 (comment)