File tree 7 files changed +17
-8
lines changed
7 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ C++ to Python.
34
34
35
35
The necessary conversion routines are defined by a caster class, which
36
36
is then "plugged into" pybind11 using one of two alternative mechanisms.
37
+
37
38
Starting with the example caster class:
38
39
39
40
.. code-block :: cpp
@@ -66,6 +67,7 @@ Starting with the example caster class:
66
67
}
67
68
return true;
68
69
}
70
+
69
71
// C++ -> Python: convert an inty instance into a Python object. The second and third arguments
70
72
// are used to indicate the return value policy and parent object (for
71
73
// return_value_policy::reference_internal) and are often ignored by custom casters.
Original file line number Diff line number Diff line change @@ -138,8 +138,6 @@ set(PYBIND11_TEST_FILES
138
138
test_iostream
139
139
test_kwargs_and_defaults
140
140
test_local_bindings
141
- test_make_caster_adl
142
- test_make_caster_adl_alt
143
141
test_methods_and_attributes
144
142
test_modules
145
143
test_multiple_inheritance
@@ -150,6 +148,8 @@ set(PYBIND11_TEST_FILES
150
148
test_operator_overloading
151
149
test_pickling
152
150
test_pytypes
151
+ test_select_caster
152
+ test_select_caster_alt
153
153
test_sequences_and_iterators
154
154
test_smart_ptr
155
155
test_stl
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ struct inty_type_caster {
64
64
}
65
65
return true ;
66
66
}
67
+
67
68
// C++ -> Python: convert an inty instance into a Python object. The second and third arguments
68
69
// are used to indicate the return value policy and parent object (for
69
70
// return_value_policy::reference_internal) and are often ignored by custom casters.
Original file line number Diff line number Diff line change 1
- // adl = Argument Dependent Lookup
1
+ // Copyright (c) 2022 The Pybind Development Team.
2
+ // All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
2
4
3
5
#include " pybind11_tests.h"
4
6
@@ -73,7 +75,7 @@ struct minimal_real_caster {
73
75
74
76
} // namespace mrc_ns
75
77
76
- TEST_SUBMODULE (make_caster_adl , m) {
78
+ TEST_SUBMODULE (select_caster , m) {
77
79
m.def (" have_a_ns_num" , []() { return py::detail::make_caster<have_a_ns::type_mock>::num (); });
78
80
m.def (" global_ns_num" , []() { return py::detail::make_caster<global_ns_type_mock>::num (); });
79
81
m.def (" unnamed_ns_num" , []() { return py::detail::make_caster<unnamed_ns_type_mock>::num (); });
Original file line number Diff line number Diff line change 1
1
import pytest
2
2
3
- from pybind11_tests import make_caster_adl as m
4
- from pybind11_tests import make_caster_adl_alt as m_alt
3
+ from pybind11_tests import select_caster as m
4
+ from pybind11_tests import select_caster_alt as m_alt
5
5
6
6
7
7
def test_mock_casters ():
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2022 The Pybind Development Team.
2
+ // All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
1
5
#include " pybind11_tests.h"
2
6
3
7
namespace have_a_ns {
@@ -10,6 +14,6 @@ struct type_mock {
10
14
11
15
} // namespace have_a_ns
12
16
13
- TEST_SUBMODULE (make_caster_adl_alt , m) {
17
+ TEST_SUBMODULE (select_caster_alt , m) {
14
18
m.def (" have_a_ns_num" , []() { return py::detail::make_caster<have_a_ns::type_mock>::num (); });
15
19
}
Original file line number Diff line number Diff line change 1
- from pybind11_tests import make_caster_adl_alt as m
1
+ from pybind11_tests import select_caster_alt as m
2
2
3
3
4
4
def test_mock_casters ():
You can’t perform that action at this time.
0 commit comments