How to have integer array as read only field from struct? #177
-
For example: How to have read only field
I have tried |
Beta Was this translation helpful? Give feedback.
Answered by
wjakob
Apr 7, 2023
Replies: 1 comment 1 reply
-
Just like in pybind11, there isn't great support for this. You can use |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
tienviitta
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 likenb::ndarray
(which can be made to return a NumPy array view).