Skip to content

Expose argument names to Python bindings #13145

@dbaston

Description

@dbaston

Feature description

Most Python functions currently have a signature (*args,**kwargs). This is a result of the SWIG feature compactdefaultargs, which is both turned on globally in several .i files using %feature("compactdefaultargs"), and turned on automatically by SWIG whenever %feature("kwargs") is used (some 400 instances). Many invocations of %feature("kwargs") are enabled only for certain languages, for reasons that are not always clear.

Full signatures (such as def OpenEx(utf8_path, nOpenFlags=0, allowed_drivers=None, open_options=None, sibling_files=None)) can be obtained by disabling compactdefaultargs using %feature("compactdefaultargs", "") and re-enabling it only for the handful of functions that require it for overload resolution. (SWIG warnings indicate which functions are affected.)

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions