Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: Reject buffers with suboffsets #20592

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

Merged
merged 1 commit into from
Dec 16, 2021
Merged

BUG: Reject buffers with suboffsets #20592

merged 1 commit into from
Dec 16, 2021

Conversation

seberg
Copy link
Member

@seberg seberg commented Dec 15, 2021

We do not actually support them (and never did). We could support
them by copying the data. But right now it seems more important
to reject them (while there was a PR to implement it, it has gotten
little attention).

Test/oiringal PR:
Co-authored-by: Alexander Belopolsky [email protected]


The PR I was referring to is this one: #7467

We do not actually support them (and never did).  We could support
them by copying the data.  But right now it seems more important
to reject them (while there was a PR to implement it, it has gotten
little attention).

Test/oiringal PR:
Co-authored-by: Alexander Belopolsky <[email protected]>
@seberg
Copy link
Member Author

seberg commented Dec 15, 2021

An interesting point is that by erroring here, we do not allow the object to still implement __array__ (because it never gets checked). But, since there are no real issues about this all being bogus, I guess it just doesn't matter in practice right now.

@mattip
Copy link
Member

mattip commented Dec 16, 2021

Does this need a release note?

@seberg
Copy link
Member Author

seberg commented Dec 16, 2021

I lean to no, because if suboffsets is set the buffer data should contain pointers, so what we return is garbage (there is a weird chance that someone sets it, but doesn't use it).

@mattip mattip merged commit a48a673 into numpy:main Dec 16, 2021
@mattip
Copy link
Member

mattip commented Dec 16, 2021

Thanks @seberg

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

Successfully merging this pull request may close these issues.

2 participants