Skip to content

Conversation

@dbs4261
Copy link

@dbs4261 dbs4261 commented Jan 26, 2026

Description

Add convenience functions to pybind11::array to return the shape and strides as a std::span. These functions are hidden with macros unless PYBIND11_CPP20 is defined and the include has been found. By returning an iterable container, a new array could be created more simply with array(other.dtype(), other.size_span(), other.strides_span()).

Suggested changelog entry:

Add convenience functions to pybind11::array to return the shape and strides as a std::span.

dbs4261 and others added 2 commits January 26, 2026 12:37
…es as a std::span. These functions are hidden with macros unless PYBIND11_CPP20 is defined and the <span> include has been found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant