From 55dc131944c764ba7e30085b971a9d70531114b3 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Tue, 14 Nov 2017 19:52:11 -0800 Subject: [PATCH] Clarify docs for functions taking bytes and not str. --- .gitignore | 1 + docs/advanced/cast/strings.rst | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c444c17e..979fd443 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ MANIFEST *.py[co] *.egg-info *~ +.*.swp .DS_Store /dist /build diff --git a/docs/advanced/cast/strings.rst b/docs/advanced/cast/strings.rst index 2cdbade3..e25701ec 100644 --- a/docs/advanced/cast/strings.rst +++ b/docs/advanced/cast/strings.rst @@ -58,7 +58,9 @@ Passing bytes to C++ -------------------- A Python ``bytes`` object will be passed to C++ functions that accept -``std::string`` or ``char*`` *without* conversion. +``std::string`` or ``char*`` *without* conversion. On Python 3, in order to +make a function *only* accept ``bytes`` (and not ``str``), declare it as taking +a ``py::bytes`` argument. Returning C++ strings to Python