Skip to content

Reconsider copy parameter values for asarray function #721

Closed as not planned
@mtsokol

Description

@mtsokol

Hi!

During yesterday's NumPy Triage Call we had a discussion about copy keyword for the asarray function, namely None/False/True choice for possible values.

The conclusion was that asarray(x, copy=None) doesn't convey the message of "make a copy only if needed", and could be replaced with something more expressive.

We came up with other possibilities, like string values:

  • Always copy: asarray(x, copy="always")
  • Copy if needed: asarray(x, copy="ifneeded")
  • Never copy: asarray(x, copy="never")

My question is: Would it make sense to move from None/bool values for copy keyword to string values in the Array API?

Each library can then use and interpret None/bool as they wish, and only adhere to Array API with new string values that can be passed for library agnostic code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wont-fixThis will not be worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

        翻译: