Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return scalar when accessing zero dimensional array #2718

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

brokkoli71
Copy link
Member

@brokkoli71 brokkoli71 commented Jan 15, 2025

TODO:

  • Add unit tests and/or doctests in docstrings
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@brokkoli71
Copy link
Member Author

brokkoli71 commented Jan 15, 2025

Do we want to return scalars when accessing zero-dimensional arrays? This would mean that the return value of __getitem__ is no longer NDArrayLike and may make typing more difficult

@brokkoli71 brokkoli71 marked this pull request as draft January 15, 2025 21:43
@dstansby
Copy link
Contributor

To copy what numpy does (see #2713 (comment)), I think we do want to return a scalar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent () indexing/size behavior from v2->v3
2 participants