Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
3ee91b2f
Commit
3ee91b2f
authored
Nov 15, 2015
by
Wenzel Jakob
Browse files
renamed pybind11::set::insert -> add to match C api naming
parent
333e889e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
example/example2.cpp
example/example2.cpp
+2
-2
include/pybind11/pytypes.h
include/pybind11/pytypes.h
+1
-1
No files found.
example/example2.cpp
View file @
3ee91b2f
...
...
@@ -30,8 +30,8 @@ public:
/* Create and return a Python set */
py
::
set
get_set
()
{
py
::
set
set
;
set
.
insert
(
py
::
str
(
"key1"
));
set
.
insert
(
py
::
str
(
"key2"
));
set
.
add
(
py
::
str
(
"key1"
));
set
.
add
(
py
::
str
(
"key2"
));
return
set
;
}
...
...
include/pybind11/pytypes.h
View file @
3ee91b2f
...
...
@@ -337,7 +337,7 @@ public:
PYBIND11_OBJECT
(
set
,
object
,
PySet_Check
)
set
()
:
object
(
PySet_New
(
nullptr
),
false
)
{
}
size_t
size
()
const
{
return
(
size_t
)
PySet_Size
(
m_ptr
);
}
void
insert
(
const
object
&
object
)
{
PySet_Add
(
m_ptr
,
(
PyObject
*
)
object
.
ptr
());
}
void
add
(
const
object
&
object
)
{
PySet_Add
(
m_ptr
,
(
PyObject
*
)
object
.
ptr
());
}
void
clear
()
{
PySet_Clear
(
ptr
());
}
};
...
...
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