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

BUG: Allow pickling all relevant DType types/classes by charris · Pull Request #18345 · numpy/numpy · GitHub

/ numpy Public

BUG: Allow pickling all relevant DType types/classes - #18345

Merged
charris merged 1 commit into
numpy:maintenance/1.20.xfrom
charris:backport-18332
Feb 6, 2021
Merged

charris merged 1 commit into
numpy:maintenance/1.20.xfrom
charris:backport-18332

Conversation

charris commented Feb 6, 2021

Copy link
Copy Markdown
Member

Backport of #18332.

Introducing the metaclass without a canonical top-level name broke
pickling of type(np.dtype(...)) (which was always just np.dtype).

While a better solution will likely be possible by making the
DTypes HeapTypes and this solution may not work for all imaginable
cases (i.e. it is plausible for a dtype to not have a scalar type
associated), using a copyreg registration for the metaclass
surprisingly works without any issues and seems like the simplest
solution right now.

Closes gh-16692, gh-18325

Introducing the metaclass without a canonical top-level name broke
pickling of `type(np.dtype(...))` (which was always just `np.dtype`).

While a better solution will likely be possible by making the
DTypes HeapTypes and this solution may not work for all imaginable
cases (i.e. it is plausible for a dtype to not have a scalar type
associated), using a `copyreg` registration for the metaclass
surprisingly works without any issues and seems like the simplest
solution right now.

Closes numpygh-16692, numpygh-18325
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