Skip to content

DEP: Deprecate/limit user modification of typeDict #15296

@seberg

Description

@seberg

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions