question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Document PyArray_GETITEM / PySequence_GetItem discrepancy

See original GitHub issue

Even for 1-D Arrays, PyArray_GETITEM returns something different from PySequence_GetItem: PyArray_GETITEM returns standard Python types while PySequence_GetItem returns the corresponding Numpy scalar types. This should be documented to avoid confusion.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
yugkhannacommented, Sep 6, 2018

I am absolutely new to this. So I should just modify the PyArray_GETITEM in the text file? @mattip

0reactions
pitroucommented, Apr 16, 2019

@eric-wieser Looks good to me, thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Infinite __getitem__ calls during NumPy array assignment
I have a list of class instances, which have a __getitem__ and a __len__ method implemented. However, when I try to create a...
Read more >
Py2kBuffer (jython-slim 2.7.2 API) - javadoc.io
Gets the indexed element of the buffer as a one byte string. This is an extension point called by PySequence in its implementation...
Read more >
Data view /slice of zarr array without loading entire array #980
From the docs, it looks like there is two options: Use getitem via ... zarr-python should work hard not to load the entire...
Read more >
Python/C API Reference Manual
This manual documents the API used by C and C++ programmers who want to ... PyObject GetItem() and PySequence GetItem(), always return a...
Read more >
User-defined slice-like objects, and slicing mappings - Ideas
I'm proposing to create a new __slice__ method in the datamodel, which would return a sequence or iterable. When indexing a list or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found