Skip to content

array.broadcast_shapes to return a tuple of int, not a tuple of NumPy scalars #11433

@trexfeathers

Description

@trexfeathers

Before NumPy v2, the repr of NumPy scalars returned a plain number. This changed in NEP 51, which changes how the result of broadcast_shapes() is printed:

  • Before: (240, 37, 49)
  • After: (np.int64(240), np.int64(37), np.int64(49))

There is no functional difference here, but it is much less intuitive to read - especially problematic for documentation/notebooks.

What does everyone think of adding a line into broadcast_shapes to ensure that only plain integers are returned? Would this have any unintended consequences? Many thanks.

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