Skip to content

Default values for function arguments don't all match in c++ and python #808

Description

@scpeters

Many of our public APIs have some optional arguments with default values, but this can be inconsistent between our C++ and python APIs.

For example, the Plane class has only one optional argument in c++: _tolerance

public: std::optional<Vector3<T>> Intersection(
const Vector3<T> &_point,
const Vector3<T> &_gradient,
const double &_tolerance = 1e-6) const

whereas all of its arguments are optional in python:

.def("intersection",
&Class::Intersection,
py::arg("_point") = gz::math::Vector3<T>::Zero,
py::arg("_gradient") = gz::math::Vector3<T>::Zero,
py::arg("_tolerance") = 1e-6,
"Get the intersection of an infinite line with the plane, "
"given the line's gradient and a point in parametrized space.")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions