Skip to content

How to have integer array as read only field from struct? #177

Closed Answered by wjakob
tienviitta asked this question in Q&A
Discussion options

You must be logged in to vote

Just like in pybind11, there isn't great support for this. You can use std::array instead (with some limitations due to the type caster) or expose the underlying storage through a property involving a type like nb::ndarray (which can be made to return a NumPy array view).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tienviitta
Comment options

Answer selected by tienviitta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants