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

Skip to content

DEP: Deprecate/limit user modification of typeDict #15296

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

Closed
seberg opened this issue Jan 8, 2020 · 1 comment
Closed

DEP: Deprecate/limit user modification of typeDict #15296

seberg opened this issue Jan 8, 2020 · 1 comment

Comments

@seberg
Copy link
Member

seberg commented Jan 8, 2020

Currently users, mainly downstream libraries adding new dtypes, can add a string to np.typeDict. This string should (but does not have to) point to a dtype or numpy-scalar type (which is associated with a dtype).

This is the hook at allows packages such as quaternion to give the user the chance to write:

np.array(..., dtype="quaternion")

(note the string). Quaternion is the likely only user, but it is brittle that typeDict is a imple dictionary. It would be nice to either:

  • Deprecate any modification of typeDict at all
  • Limit additions to typeDict to only include numpy-scalar type objects (and maybe dtype instances). Looking forward to new dtypes, this limit could be extended to only "old style" dtypes, so that it gets naturally weeded out (even if it forces quaternion users to change their patterns, as the likely only user).
@seberg
Copy link
Member Author

seberg commented Jan 22, 2024

This was effectively the same as gh-24699, since that has discussion, closing this one.

@seberg seberg closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant