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
6e6975e2
Unverified
Commit
6e6975e2
authored
Sep 20, 2021
by
Aaron Gokaslan
Committed by
GitHub
Sep 20, 2021
Browse files
Fix test case with __new__ (#3285)
parent
d0f3c51f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
tests/test_class.cpp
tests/test_class.cpp
+3
-2
No files found.
tests/test_class.cpp
View file @
6e6975e2
...
...
@@ -63,8 +63,9 @@ TEST_SUBMODULE(class_, m) {
.
def_static
(
"new_instance"
,
&
NoConstructor
::
new_instance
,
"Return an instance"
);
py
::
class_
<
NoConstructorNew
>
(
m
,
"NoConstructorNew"
)
.
def
(
py
::
init
([](
NoConstructorNew
*
self
)
{
return
self
;
}))
// Need a NOOP __init__
.
def_static
(
"__new__"
,
[](
const
py
::
object
*
)
{
return
NoConstructorNew
::
new_instance
();
}
);
.
def
(
py
::
init
([](
const
NoConstructorNew
&
self
)
{
return
self
;
}))
// Need a NOOP __init__
.
def_static
(
"__new__"
,
[](
const
py
::
object
&
)
{
return
NoConstructorNew
::
new_instance
();
});
// test_inheritance
class
Pet
{
...
...
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