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

BUG: Operation spuriously returns a legacy string · Issue #27637 · numpy/numpy · GitHub

/ numpy Public

BUG: Operation spuriously returns a legacy string #27637

Description

After applying the changes from #27636:

>>> print(repr(np.strings.replace(
            np.array(["hello planet"], dtype="U"),
            np.array("planet", dtype="T"),
            np.array("world", dtype="T"))))
array(['hello world'], dtype='<U11')

We get a unicode array back, despite the fact that StringDType explicitly installs a promoter for this case.

I thought this had something to do with the fact that the legacy string unicode promoters work by constructing a promoter DType tuple that's filled with None entries. But that's fine, since None has less priority than a specific DType.

Instead something else is going on. I got as far as tracing through the call to resolve_descriptors, which does correctly set the output DType to StringDType, so something else fishy is going on later when the actual output array is created.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL