Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
cd4b49a2
Unverified
Commit
cd4b49a2
authored
Jun 17, 2021
by
Aaron Gokaslan
Committed by
GitHub
Jun 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update py::kwargs examples to pass by reference (#3038)
parent
4c7697db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
docs/advanced/functions.rst
+2
-2
No files found.
docs/advanced/functions.rst
View file @
cd4b49a2
...
@@ -254,7 +254,7 @@ For instance, the following statement iterates over a Python ``dict``:
...
@@ -254,7 +254,7 @@ For instance, the following statement iterates over a Python ``dict``:
.. code-block:: cpp
.. code-block:: cpp
void print_dict(
py::dict
dict) {
void print_dict(
const py::dict&
dict) {
/* Easily interact with Python types */
/* Easily interact with Python types */
for (auto item : dict)
for (auto item : dict)
std::cout << "key=" << std::string(py::str(item.first)) << ", "
std::cout << "key=" << std::string(py::str(item.first)) << ", "
...
@@ -292,7 +292,7 @@ Such functions can also be created using pybind11:
...
@@ -292,7 +292,7 @@ Such functions can also be created using pybind11:
.. code-block:: cpp
.. code-block:: cpp
void generic(py::args args,
py::kwargs
kwargs) {
void generic(py::args args,
const py::kwargs&
kwargs) {
/// .. do something with args
/// .. do something with args
if (kwargs)
if (kwargs)
/// .. do something with kwargs
/// .. do something with kwargs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment