Skip to content

[BUG] Clearer commitment to public / stable API? (most importantly, type_caster) #2763

Open
@EricCousineau-TRI

Description

@EricCousineau-TRI

At present, type_caster is something that exists in the py::detail namespace, but may be overloaded in downstream applications, either via a macro, or more directly.

A naive downstream example (that I wrote 😬):
https://github.com/RobotLocomotion/drake/blob/v0.25.0/bindings/pydrake/common/wrap_pybind.h#L54-L114
https://github.com/RobotLocomotion/drake/blob/v0.25.0/bindings/pydrake/common/cpp_param_pybind.h#L149-L158

At present, my reading of py::detail is that it's generally internal implementation details, i.e. it's internal, not public API, and should not be expected to be stable.

It seems like the base contract of py::detail::type_caster may more-or-less be leaked into a public details. We may want to consider making this more public, and having some level of public stability for this. In this way, we could hoist it outside of py::detail, so we could keep that reserved for truly internal details.

Possibly related:

\cc @rwgk @YannickJadoul @rhaschke @wjakob

Metadata

Metadata

Assignees

No one assigned

    Labels

    castersRelated to casters, and to be taken into account when analyzing/reworking casters

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions