FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

MAINT: gracefully shuffle memoryviews by charris · Pull Request #18327 · numpy/numpy · GitHub

/ numpy Public

MAINT: gracefully shuffle memoryviews - #18327

Merged
charris merged 2 commits into
numpy:maintenance/1.20.xfrom
charris:backport-18282
Feb 4, 2021
Merged

charris merged 2 commits into
numpy:maintenance/1.20.xfrom
charris:backport-18282

Conversation

charris commented Feb 4, 2021

Copy link
Copy Markdown
Member

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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL