Skip to content

How to bind C++ non-arguments function to Python constant attributes/variables ? #3575

Answered by linrongbin16
linrongbin16 asked this question in Q&A
Discussion options

You must be logged in to vote

I found answer here: https://pybind11.readthedocs.io/en/stable/advanced/classes.html#static-properties. use def_property_readonly_static with lambda could bind C++ class static non-arguments method to Python class static constant attributes/variables.

But I still have no idea about how to bind C++ non-arguments function to Python constant attributes/variables.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by linrongbin16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant