Define PYBIND11_STR_CASTER_NO_IMPLICIT_DECODE, but only for Python 3.

Also defining this for Python 2 would require many insertions of
six.ensure_text() in client code.
parent 6e18f15d
......@@ -168,7 +168,9 @@
// If DEFINED, pybind11::str can only hold PyUnicodeObject, and
// pybind11::isinstance<str>() is true only for pybind11::str.
//#define PYBIND11_STR_CASTER_NO_IMPLICIT_DECODE
#if PY_MAJOR_VERSION >= 3
#define PYBIND11_STR_CASTER_NO_IMPLICIT_DECODE
#endif
// This macro has an effect only if PYBIND11_STR_NON_PERMISSIVE is defined.
// If UNDEFINED, the pybind11::str caster will implicitly decode bytes to PyUnicodeObject.
// If DEFINED, the pybind11::str caster will only accept PyUnicodeObject.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment