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

MAINT: gracefully shuffle memoryviews #18327

Merged
merged 2 commits into from Feb 4, 2021

Conversation

charris
Copy link
Member

@charris charris commented Feb 4, 2021

Backport of #18282.

Fixes gh-18273

  • allow graceful shuffling of memoryviews, with
    same behavior as arrays, instead of producing
    a warning on memoryview shuffle

There's certainly some contention that me doing this downstream was sub-optimal anyway, but I don't think there's any claim that it should be disallowed/considered a bug to shuffle a memoryview.

I was originally going to special case 1-D C-contiguous memoryviews, but the discussion in the matching issue seems to suggest that just using asarray() without fancy special casing might be the way to go?

* allow graceful shuffling of memoryviews, with
same behavior as arrays, instead of producing
a warning on `memoryview` shuffle
* based on reviewer feedback, instead of explicitly
supporting `memoryview` shuffling via `asarray()`, support
the shuffling implicitly by using `Sequence` instead
of `MutableSequence`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants