pybind11 icon indicating copy to clipboard operation
pybind11 copied to clipboard

Expand string_caster support to uint8_t and std::byte

Open Guillaume227 opened this issue 3 years ago • 1 comments

Description

I would like to get easier handling of std::basic_string and std::basic_string_view for uint8_t and std::byte underlying types. Those types are meant to represent raw data and thus should skip decoding / encoding steps, which the existing code already has support for using string_caster::load_raw and py::bytes.

Let me know if that looks like it belongs there, I still need to add test coverage before that goes in (have tested on my external use case).

Suggested changelog entry:

Add support for conversion of std::string_view<uint8_t> and std::string_viewstd::byte.

Guillaume227 avatar Mar 16 '22 15:03 Guillaume227

~Hmm, okay I am not sure why the CI isn't running for this PR... Thoughts @henryiii @rwgk?~

Update: Working now

Skylion007 avatar Mar 16 '22 15:03 Skylion007