Skip to content

[enhancement] Nicer error handling / more support for arguments #2460

Open
@henryiii

Description

@henryiii

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 and py::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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions