Clarify docs for functions taking bytes and not str.

This commit is contained in:
Antony Lee 2017-11-14 19:52:11 -08:00 committed by Wenzel Jakob
parent 27c7697f24
commit d3908be61d
2 changed files with 4 additions and 1 deletions

1
.gitignore vendored
View File

@ -27,6 +27,7 @@ MANIFEST
*.py[co] *.py[co]
*.egg-info *.egg-info
*~ *~
.*.swp
.DS_Store .DS_Store
/dist /dist
/build /build

View File

@ -58,7 +58,9 @@ Passing bytes to C++
-------------------- --------------------
A Python ``bytes`` object will be passed to C++ functions that accept 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 Returning C++ strings to Python