Open
Description
There are several possible ways to improve argument handling, but that probably doesn't have to be in this PR. Ideas:
(a, *args, b=None)
is valid in Python but not pybind11.(a, /, **kwargs)
allows "a=" to go into kwargs(a, / a)
isn't valid in Python, but we could allow it- We could check to make sure
py::pos_only()
is not at the beginning andpy::kw_only()
is not at the end. - We could have a nice error if either was given twice or in the wrong order.
Originally posted by @henryiii in #2459 (comment)