absl_test.py
21.8 KB
-
`type_caster<absl::Cord>`: return Python `str` when given `return_value_policy::_clif_automatic`. · 01171e9d
Compared to other string-kind `type_caster`s in pybind11, `type_caster<absl::Cord>` is unusual in that it returns `bytes`. All other string-kind `type_caster`s return `str` and can be directed to use `bytes` instead via `return_value_policy::_return_as_bytes`. There is no `return_value_policy::return_as_str` that we could use here. Introducing such a policy just for `type_caster<absl::Cord>` seems heavy-handed. The existing `return_value_policy::_clif_automatic` fits this niche case organically and is fully sufficient for the purposes of PyCLIF-pybind11. PiperOrigin-RevId: 620916112
Ralf W. Grosse-Kunstleve committed