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
3ee91b2f
Commit
3ee91b2f
authored
Nov 15, 2015
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed pybind11::set::insert -> add to match C api naming
parent
333e889e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
example/example2.cpp
+2
-2
include/pybind11/pytypes.h
+1
-1
No files found.
example/example2.cpp
View file @
3ee91b2f
...
@@ -30,8 +30,8 @@ public:
...
@@ -30,8 +30,8 @@ public:
/* Create and return a Python set */
/* Create and return a Python set */
py
::
set
get_set
()
{
py
::
set
get_set
()
{
py
::
set
set
;
py
::
set
set
;
set
.
insert
(
py
::
str
(
"key1"
));
set
.
add
(
py
::
str
(
"key1"
));
set
.
insert
(
py
::
str
(
"key2"
));
set
.
add
(
py
::
str
(
"key2"
));
return
set
;
return
set
;
}
}
...
...
include/pybind11/pytypes.h
View file @
3ee91b2f
...
@@ -337,7 +337,7 @@ public:
...
@@ -337,7 +337,7 @@ public:
PYBIND11_OBJECT
(
set
,
object
,
PySet_Check
)
PYBIND11_OBJECT
(
set
,
object
,
PySet_Check
)
set
()
:
object
(
PySet_New
(
nullptr
),
false
)
{
}
set
()
:
object
(
PySet_New
(
nullptr
),
false
)
{
}
size_t
size
()
const
{
return
(
size_t
)
PySet_Size
(
m_ptr
);
}
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
());
}
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