pybind / pybind11

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

Separate optional and variant support from other STL containers #1207

Open funchal opened 6 years ago

funchal commented 6 years ago

I'd like to propose that we:

My motivation for this proposal is that the conversion for other containers (set/vector/map) in pybind11/stl.h comes with a major downside, documented in http://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html#automatic-conversion, and I believe that optional/variant can be useful in their own right.

If you like the idea, I'm happy to prepare a pull request. Please let me know. #

wjakob commented 6 years ago

Hi @funchal ,

This sounds reasonable to me. Do you want to create a PR? (please also mention this in the documentation and the changelog file).

Best, Wenzel

funchal commented 6 years ago

Here you go: https://github.com/pybind/pybind11/pull/1210

funchal commented 6 years ago

Quick reminder, there is still interest in resolving this issue. stl.h has too much stuff in it some of it I want and some I don't. I currently have to workaround this would be great to get some solution in place.