Skip to content

PixelArray issues group #3953

Description

@Starbuck5

@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.

  1. (typing only: bug) Missing __getitem__ overloads for two-element tuples other than tuple[int, int], as well as one-element tuples
  2. (mentioned issue: API) Should not return None from __getitem__ with empty slice (not how slicing should work)
  3. (API/bug) __getitem__ with single ellipsis argument returns self reference instead of new copy
  4. (API/bug?) None is intended to be same as ellipsis, but None alone cannot be used as index for __getitem__ or __setitem__
  5. (typing only: improvement) Both 1D and 2D PixelArrays currently share the same signatures for type checking, which is a mess
  6. (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",)])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions