pybind / pybind/pybind11

dynamic type description

Open
#2,030 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
18k
Forks
2.3k
Avg merge
5d 17h
Merged PRs (30d)
10

Description

In the context of DDS I have a set of types described in an IDL. These types have corresponding implementations in both, C++ and python and there is a generic type conversion mechanism based on serialization and deserialization in both languages (and exchange of the serialized buffer between C++ and python).
While I have the type conversion running , I'm puzzled how to pass a nicely formatted type name to PYBIND11_TYPE_CASTER. As far as I can see, the macro expects a pybind11::detail::descr and I was able to pass _<T>(). However, this produces the C++ type name, while I have a function to "compute" the corresponding python type name. Is there a possibility to pass a name that is not a constexpr?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the PYBIND11_TYPE_CASTER macro and pybind11::detail::descr usage, then compare them with the existing C++ and Python serialization and deserialization conversion mechanism. Determine whether a dynamically computed Python type name can be represented, and define the expected behavior for generated type descriptions before proposing a change.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.