You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
For the most use cases, we use
py::arg("name")
to explicitly define the argument name in the binding code:which binds a Python function:
In Functions: Accepting
*args
and**kwargs
:The code binds a python function:
However,
py::args
do not allow the user defines a custom name of the*args
argument. For example, the following code:binds a Python function:
while in Python REPL:
the
*pos_args
handle appears as*args
in the function signature.The handle name of
py::args
andpy::kwargs
are hardcoded and are not customizable:pybind11/include/pybind11/cast.h
Lines 900 to 907 in 7c6f2f8
Beta Was this translation helpful? Give feedback.
All reactions