Skip to content

Commit 55dc131

Browse files
anntzerjagerman
authored andcommitted
Clarify docs for functions taking bytes and not str.
1 parent e763f04 commit 55dc131

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ MANIFEST
2727
*.py[co]
2828
*.egg-info
2929
*~
30+
.*.swp
3031
.DS_Store
3132
/dist
3233
/build

docs/advanced/cast/strings.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ Passing bytes to C++
5858
--------------------
5959

6060
A Python ``bytes`` object will be passed to C++ functions that accept
61-
``std::string`` or ``char*`` *without* conversion.
61+
``std::string`` or ``char*`` *without* conversion. On Python 3, in order to
62+
make a function *only* accept ``bytes`` (and not ``str``), declare it as taking
63+
a ``py::bytes`` argument.
6264

6365

6466
Returning C++ strings to Python

0 commit comments

Comments
 (0)