Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
0e04fdf3
Commit
0e04fdf3
authored
Mar 08, 2016
by
Sylvain Corlay
Browse files
Add generic signature for overloads
parent
13b22bf4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+7
-0
No files found.
include/pybind11/pybind11.h
View file @
0e04fdf3
...
@@ -295,6 +295,13 @@ protected:
...
@@ -295,6 +295,13 @@ protected:
int
index
=
0
;
int
index
=
0
;
/* Create a nice pydoc rec including all signatures and
/* Create a nice pydoc rec including all signatures and
docstrings of the functions in the overload chain */
docstrings of the functions in the overload chain */
if
(
chain
)
{
// First a generic signature
signatures
+=
rec
->
name
;
signatures
+=
"(*args, **kwargs)
\n
"
;
signatures
+=
"Overloaded function.
\n\n
"
;
}
// Then specific overload signatures
for
(
auto
it
=
chain_start
;
it
!=
nullptr
;
it
=
it
->
next
)
{
for
(
auto
it
=
chain_start
;
it
!=
nullptr
;
it
=
it
->
next
)
{
if
(
chain
)
if
(
chain
)
signatures
+=
std
::
to_string
(
++
index
)
+
". "
;
signatures
+=
std
::
to_string
(
++
index
)
+
". "
;
...
...
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