Skip to content

Order of generic types for ndarray #16547

@shoyer

Description

@shoyer

Per python/typing#516, it seems likely that we will have a choice between two ways to write type hints:

  1. ndarray[Dtype, Shape]
  2. ndarray[Shape, Dtype]

We'll probably have two generic arguments, but will have the freedom to choose in which order they appear. Do we have any reason to prefer one order over the other?

One weak argument in favor of [Shape, Dtype] is that it matches ndarray.__new__ (but that's so rarely used that it probably doesn't matter).

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