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
d23c821b
Commit
d23c821b
authored
Jun 11, 2019
by
Yannick Jadoul
Committed by
Wenzel Jakob
Jun 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make static member functions, added with `def_static`, `staticmethod` descriptor instances (#1732)
parent
7a24bcf1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
include/pybind11/pybind11.h
+1
-1
include/pybind11/pytypes.h
+7
-0
No files found.
include/pybind11/pybind11.h
View file @
d23c821b
...
@@ -1121,7 +1121,7 @@ public:
...
@@ -1121,7 +1121,7 @@ public:
"def_static(...) called with a non-static member function pointer"
);
"def_static(...) called with a non-static member function pointer"
);
cpp_function
cf
(
std
::
forward
<
Func
>
(
f
),
name
(
name_
),
scope
(
*
this
),
cpp_function
cf
(
std
::
forward
<
Func
>
(
f
),
name
(
name_
),
scope
(
*
this
),
sibling
(
getattr
(
*
this
,
name_
,
none
())),
extra
...);
sibling
(
getattr
(
*
this
,
name_
,
none
())),
extra
...);
attr
(
cf
.
name
())
=
cf
;
attr
(
cf
.
name
())
=
staticmethod
(
cf
)
;
return
*
this
;
return
*
this
;
}
}
...
...
include/pybind11/pytypes.h
View file @
d23c821b
...
@@ -742,6 +742,8 @@ inline bool PyEllipsis_Check(PyObject *o) { return o == Py_Ellipsis; }
...
@@ -742,6 +742,8 @@ inline bool PyEllipsis_Check(PyObject *o) { return o == Py_Ellipsis; }
inline
bool
PyUnicode_Check_Permissive
(
PyObject
*
o
)
{
return
PyUnicode_Check
(
o
)
||
PYBIND11_BYTES_CHECK
(
o
);
}
inline
bool
PyUnicode_Check_Permissive
(
PyObject
*
o
)
{
return
PyUnicode_Check
(
o
)
||
PYBIND11_BYTES_CHECK
(
o
);
}
inline
bool
PyStaticMethod_Check
(
PyObject
*
o
)
{
return
o
->
ob_type
==
&
PyStaticMethod_Type
;
}
class
kwargs_proxy
:
public
handle
{
class
kwargs_proxy
:
public
handle
{
public
:
public
:
explicit
kwargs_proxy
(
handle
h
)
:
handle
(
h
)
{
}
explicit
kwargs_proxy
(
handle
h
)
:
handle
(
h
)
{
}
...
@@ -1281,6 +1283,11 @@ public:
...
@@ -1281,6 +1283,11 @@ public:
bool
is_cpp_function
()
const
{
return
(
bool
)
cpp_function
();
}
bool
is_cpp_function
()
const
{
return
(
bool
)
cpp_function
();
}
};
};
class
staticmethod
:
public
object
{
public
:
PYBIND11_OBJECT_CVT
(
staticmethod
,
object
,
detail
::
PyStaticMethod_Check
,
PyStaticMethod_New
)
};
class
buffer
:
public
object
{
class
buffer
:
public
object
{
public
:
public
:
PYBIND11_OBJECT_DEFAULT
(
buffer
,
object
,
PyObject_CheckBuffer
)
PYBIND11_OBJECT_DEFAULT
(
buffer
,
object
,
PyObject_CheckBuffer
)
...
...
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