Skip to content

rename or alias get_namespace to array_namespace #19

Closed

Description

@ntessore

Having a function array_namespace seems more intuitive than get_namespace, mainly due to symmetry with e.g. repr(), str(), iter(), next(), since array_namespace(x) returns x.__array_namespace__() if it exists, and does something sensible if it does not.

Activity

  1. rgommers commented on Mar 5, 2023

    @rgommers
    Member

    Thanks for the suggestion @ntessore. On the one hand, I can see that the name may be slightly nicer. On the other hand, this package is already past version 1.0, and the get_namespace name is already used in other places (e.g., https://numpy.org/neps/nep-0047-array-api-standard.html). So I'm not sure that this is worth the churn.

  2. ntessore commented on Mar 5, 2023

    @ntessore
    Author

    That's expected, of course, but I thought I should bring this up at least while the NEP is still a draft.

  3. asmeurer commented on Mar 6, 2023

    @asmeurer
    Member

    I agree it does seem like a better name to match __array_namespace__. We would probably want to keep get_namespace too if we change it just because we did already do a release with it.

  4. added a commit that references this issue on Mar 8, 2023
    eaf1e52
  5. asmeurer commented on Mar 8, 2023

    @asmeurer
    Member

    I'm actually in favor of this, but I've made it as a separate PR in case there are any objections #29. I kept get_namespace as an (undocumented) backwards compatible wrapper.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions