pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.56k stars 2.09k forks source link

feat(types): Adds support for Typing.Callable Special Case #5202

Closed InvincibleRMC closed 3 months ago

InvincibleRMC commented 3 months ago

Description

Adds support for special case defined by pep 484.

Suggested changelog entry:

  Add support for ``Typing.Callable[..., T]``
rwgk commented 3 months ago

@InvincibleRMC If you have more of these, is there a chance that you could combine them, to reduce the churn here?

I'm also curious: Why/how do you decide what to add? Is this feeding into something specific?

InvincibleRMC commented 3 months ago

I don't have anymore implementations that currently work. I've been trying to get Protocol/TypeDict/Generic working but, no luck so far. For choosing what to add I have mostly just been going through Python's typing api and attempting to add them into typing.h. I don't have any specific need right now but, in the future I'm hoping to improve https://github.com/ros2/rclpy pybinded types.