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
eb5277b3
Commit
eb5277b3
authored
Mar 09, 2016
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #119 from SylvainCorlay/docstring
Signature formatting for sphinx
parents
14cefbf4
4c7bf9bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
example/example11.ref
+4
-4
include/pybind11/pybind11.h
+8
-1
No files found.
example/example11.ref
View file @
eb5277b3
Help on built-in function kw_func in module example
Help on built-in function kw_func in module example
kkww__ffuunncc(...)
kkww__ffuunncc(...)
Signature :
(x : int, y : int) -> NoneType
kw_func
(x : int, y : int) -> NoneType
Help on built-in function kw_func2 in module example
Help on built-in function kw_func2 in module example
kkww__ffuunncc22(...)
kkww__ffuunncc22(...)
Signature :
(x : int = 100L, y : int = 200L) -> NoneType
kw_func2
(x : int = 100L, y : int = 200L) -> NoneType
Help on built-in function kw_func3 in module example
Help on built-in function kw_func3 in module example
kkww__ffuunncc33(...)
kkww__ffuunncc33(...)
Signature :
(data : unicode = u'Hello world!') -> NoneType
kw_func3
(data : unicode = u'Hello world!') -> NoneType
Help on built-in function kw_func4 in module example
Help on built-in function kw_func4 in module example
kkww__ffuunncc44(...)
kkww__ffuunncc44(...)
Signature :
(myList : list<int> = [13L, 17L]) -> NoneType
kw_func4
(myList : list<int> = [13L, 17L]) -> NoneType
kw_func(x=5, y=10)
kw_func(x=5, y=10)
kw_func(x=5, y=10)
kw_func(x=5, y=10)
...
...
include/pybind11/pybind11.h
View file @
eb5277b3
...
@@ -295,10 +295,17 @@ protected:
...
@@ -295,10 +295,17 @@ 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
)
+
". "
;
signatures
+=
"Signature : "
;
signatures
+=
rec
->
name
;
signatures
+=
it
->
signature
;
signatures
+=
it
->
signature
;
signatures
+=
"
\n
"
;
signatures
+=
"
\n
"
;
if
(
it
->
doc
&&
strlen
(
it
->
doc
)
>
0
)
{
if
(
it
->
doc
&&
strlen
(
it
->
doc
)
>
0
)
{
...
...
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