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
4f1531c4
Commit
4f1531c4
authored
May 15, 2020
by
Sergei Izmailov
Committed by
Wenzel Jakob
Jun 10, 2020
Browse files
Render `py::int_` as `int` in docstrings
parent
90d99b56
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
0 deletions
+5
-0
include/pybind11/cast.h
include/pybind11/cast.h
+1
-0
tests/test_pytypes.cpp
tests/test_pytypes.cpp
+2
-0
tests/test_pytypes.py
tests/test_pytypes.py
+2
-0
No files found.
include/pybind11/cast.h
View file @
4f1531c4
...
@@ -1606,6 +1606,7 @@ template <typename base, typename deleter> struct is_holder_type<base, std::uniq
...
@@ -1606,6 +1606,7 @@ template <typename base, typename deleter> struct is_holder_type<base, std::uniq
template
<
typename
T
>
struct
handle_type_name
{
static
constexpr
auto
name
=
_
<
T
>
();
};
template
<
typename
T
>
struct
handle_type_name
{
static
constexpr
auto
name
=
_
<
T
>
();
};
template
<
>
struct
handle_type_name
<
bytes
>
{
static
constexpr
auto
name
=
_
(
PYBIND11_BYTES_NAME
);
};
template
<
>
struct
handle_type_name
<
bytes
>
{
static
constexpr
auto
name
=
_
(
PYBIND11_BYTES_NAME
);
};
template
<
>
struct
handle_type_name
<
int_
>
{
static
constexpr
auto
name
=
_
(
"int"
);
};
template
<
>
struct
handle_type_name
<
iterable
>
{
static
constexpr
auto
name
=
_
(
"Iterable"
);
};
template
<
>
struct
handle_type_name
<
iterable
>
{
static
constexpr
auto
name
=
_
(
"Iterable"
);
};
template
<
>
struct
handle_type_name
<
iterator
>
{
static
constexpr
auto
name
=
_
(
"Iterator"
);
};
template
<
>
struct
handle_type_name
<
iterator
>
{
static
constexpr
auto
name
=
_
(
"Iterator"
);
};
template
<
>
struct
handle_type_name
<
args
>
{
static
constexpr
auto
name
=
_
(
"*args"
);
};
template
<
>
struct
handle_type_name
<
args
>
{
static
constexpr
auto
name
=
_
(
"*args"
);
};
...
...
tests/test_pytypes.cpp
View file @
4f1531c4
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
TEST_SUBMODULE
(
pytypes
,
m
)
{
TEST_SUBMODULE
(
pytypes
,
m
)
{
// test_int
m
.
def
(
"get_int"
,
[]{
return
py
::
int_
(
0
);});
// test_list
// test_list
m
.
def
(
"get_list"
,
[]()
{
m
.
def
(
"get_list"
,
[]()
{
py
::
list
list
;
py
::
list
list
;
...
...
tests/test_pytypes.py
View file @
4f1531c4
...
@@ -5,6 +5,8 @@ import sys
...
@@ -5,6 +5,8 @@ import sys
from
pybind11_tests
import
pytypes
as
m
from
pybind11_tests
import
pytypes
as
m
from
pybind11_tests
import
debug_enabled
from
pybind11_tests
import
debug_enabled
def
test_int
(
doc
):
assert
doc
(
m
.
get_int
)
==
"get_int() -> int"
def
test_list
(
capture
,
doc
):
def
test_list
(
capture
,
doc
):
with
capture
:
with
capture
:
...
...
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