blob: 4127d68bb437932fc0fcf2bd7deb07e074fab229 [file] [log] [blame]
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -04001/*
Dean Moldovana0c1ccf2016-08-12 13:50:00 +02002 tests/test_virtual_functions.cpp -- overriding virtual functions from Python
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -04003
4 Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>
5
6 All rights reserved. Use of this source code is governed by a
7 BSD-style license that can be found in the LICENSE file.
8*/
9
Dean Moldovana0c1ccf2016-08-12 13:50:00 +020010#include "pybind11_tests.h"
11#include "constructor_stats.h"
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -040012#include <pybind11/functional.h>
13
14/* This is an example class that we'll want to be able to extend from Python */
15class ExampleVirt {
16public:
Jason Rhinelander3f589372016-08-07 13:05:26 -040017 ExampleVirt(int state) : state(state) { print_created(this, state); }
18 ExampleVirt(const ExampleVirt &e) : state(e.state) { print_copy_created(this); }
19 ExampleVirt(ExampleVirt &&e) : state(e.state) { print_move_created(this); e.state = 0; }
20 ~ExampleVirt() { print_destroyed(this); }
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -040021
22 virtual int run(int value) {
Dean Moldovan81511be2016-09-07 00:50:10 +020023 py::print("Original implementation of "
Jason Rhinelander7dfb9322016-09-08 14:49:43 -040024 "ExampleVirt::run(state={}, value={}, str1={}, str2={})"_s.format(state, value, get_string1(), *get_string2()));
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -040025 return state + value;
26 }
27
28 virtual bool run_bool() = 0;
29 virtual void pure_virtual() = 0;
Jason Rhinelander7dfb9322016-09-08 14:49:43 -040030
31 // Returning a reference/pointer to a type converted from python (numbers, strings, etc.) is a
32 // bit trickier, because the actual int& or std::string& or whatever only exists temporarily, so
33 // we have to handle it specially in the trampoline class (see below).
34 virtual const std::string &get_string1() { return str1; }
35 virtual const std::string *get_string2() { return &str2; }
36
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -040037private:
38 int state;
Jason Rhinelander7dfb9322016-09-08 14:49:43 -040039 const std::string str1{"default1"}, str2{"default2"};
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -040040};
41
42/* This is a wrapper class that must be generated */
43class PyExampleVirt : public ExampleVirt {
44public:
45 using ExampleVirt::ExampleVirt; /* Inherit constructors */
46
Jason Rhinelander116d37c2016-09-08 14:47:05 -040047 int run(int value) override {
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -040048 /* Generate wrapping code that enables native function overloading */
49 PYBIND11_OVERLOAD(
50 int, /* Return type */
51 ExampleVirt, /* Parent class */
52 run, /* Name of function */
53 value /* Argument(s) */
54 );
55 }
56
Jason Rhinelander116d37c2016-09-08 14:47:05 -040057 bool run_bool() override {
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -040058 PYBIND11_OVERLOAD_PURE(
59 bool, /* Return type */
60 ExampleVirt, /* Parent class */
61 run_bool, /* Name of function */
62 /* This function has no arguments. The trailing comma
63 in the previous line is needed for some compilers */
64 );
65 }
66
Jason Rhinelander116d37c2016-09-08 14:47:05 -040067 void pure_virtual() override {
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -040068 PYBIND11_OVERLOAD_PURE(
69 void, /* Return type */
70 ExampleVirt, /* Parent class */
71 pure_virtual, /* Name of function */
72 /* This function has no arguments. The trailing comma
73 in the previous line is needed for some compilers */
74 );
75 }
Jason Rhinelander7dfb9322016-09-08 14:49:43 -040076
77 // We can return reference types for compatibility with C++ virtual interfaces that do so, but
78 // note they have some significant limitations (see the documentation).
79 const std::string &get_string1() override {
80 PYBIND11_OVERLOAD(
81 const std::string &, /* Return type */
82 ExampleVirt, /* Parent class */
83 get_string1, /* Name of function */
84 /* (no arguments) */
85 );
86 }
87
88 const std::string *get_string2() override {
89 PYBIND11_OVERLOAD(
90 const std::string *, /* Return type */
91 ExampleVirt, /* Parent class */
92 get_string2, /* Name of function */
93 /* (no arguments) */
94 );
95 }
96
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -040097};
98
Jason Rhinelandered148792016-07-21 21:31:05 -040099class NonCopyable {
100public:
Jason Rhinelander3f589372016-08-07 13:05:26 -0400101 NonCopyable(int a, int b) : value{new int(a*b)} { print_created(this, a, b); }
102 NonCopyable(NonCopyable &&o) { value = std::move(o.value); print_move_created(this); }
Jason Rhinelandered148792016-07-21 21:31:05 -0400103 NonCopyable(const NonCopyable &) = delete;
104 NonCopyable() = delete;
105 void operator=(const NonCopyable &) = delete;
106 void operator=(NonCopyable &&) = delete;
107 std::string get_value() const {
108 if (value) return std::to_string(*value); else return "(null)";
109 }
Jason Rhinelander3f589372016-08-07 13:05:26 -0400110 ~NonCopyable() { print_destroyed(this); }
Jason Rhinelandered148792016-07-21 21:31:05 -0400111
112private:
113 std::unique_ptr<int> value;
114};
115
116// This is like the above, but is both copy and movable. In effect this means it should get moved
117// when it is not referenced elsewhere, but copied if it is still referenced.
118class Movable {
119public:
Jason Rhinelander3f589372016-08-07 13:05:26 -0400120 Movable(int a, int b) : value{a+b} { print_created(this, a, b); }
121 Movable(const Movable &m) { value = m.value; print_copy_created(this); }
122 Movable(Movable &&m) { value = std::move(m.value); print_move_created(this); }
Dean Moldovan99dbdc12016-08-19 13:45:36 +0200123 std::string get_value() const { return std::to_string(value); }
Jason Rhinelander3f589372016-08-07 13:05:26 -0400124 ~Movable() { print_destroyed(this); }
Jason Rhinelandered148792016-07-21 21:31:05 -0400125private:
126 int value;
127};
128
129class NCVirt {
130public:
131 virtual NonCopyable get_noncopyable(int a, int b) { return NonCopyable(a, b); }
132 virtual Movable get_movable(int a, int b) = 0;
133
Dean Moldovan99dbdc12016-08-19 13:45:36 +0200134 std::string print_nc(int a, int b) { return get_noncopyable(a, b).get_value(); }
135 std::string print_movable(int a, int b) { return get_movable(a, b).get_value(); }
Jason Rhinelandered148792016-07-21 21:31:05 -0400136};
137class NCVirtTrampoline : public NCVirt {
Wenzel Jakob1ffce742016-08-25 01:43:33 +0200138#if !defined(__INTEL_COMPILER)
Jason Rhinelander116d37c2016-09-08 14:47:05 -0400139 NonCopyable get_noncopyable(int a, int b) override {
Jason Rhinelandered148792016-07-21 21:31:05 -0400140 PYBIND11_OVERLOAD(NonCopyable, NCVirt, get_noncopyable, a, b);
141 }
Wenzel Jakob1ffce742016-08-25 01:43:33 +0200142#endif
Jason Rhinelander116d37c2016-09-08 14:47:05 -0400143 Movable get_movable(int a, int b) override {
Jason Rhinelandered148792016-07-21 21:31:05 -0400144 PYBIND11_OVERLOAD_PURE(Movable, NCVirt, get_movable, a, b);
145 }
146};
147
Jason Rhinelander391c7542017-07-25 16:47:36 -0400148struct Base {
149 /* for some reason MSVC2015 can't compile this if the function is pure virtual */
150 virtual std::string dispatch() const { return {}; };
151};
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -0400152
Jason Rhinelander391c7542017-07-25 16:47:36 -0400153struct DispatchIssue : Base {
154 virtual std::string dispatch() const {
155 PYBIND11_OVERLOAD_PURE(std::string, Base, dispatch, /* no arguments */);
156 }
157};
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -0400158
Jason Rhinelander391c7542017-07-25 16:47:36 -0400159// Forward declaration (so that we can put the main tests here; the inherited virtual approaches are
160// rather long).
161void initialize_inherited_virtuals(py::module &m);
162
163TEST_SUBMODULE(virtual_functions, m) {
164 // test_override
165 py::class_<ExampleVirt, PyExampleVirt>(m, "ExampleVirt")
166 .def(py::init<int>())
167 /* Reference original class in function definitions */
168 .def("run", &ExampleVirt::run)
169 .def("run_bool", &ExampleVirt::run_bool)
170 .def("pure_virtual", &ExampleVirt::pure_virtual);
171
172 py::class_<NonCopyable>(m, "NonCopyable")
173 .def(py::init<int, int>());
174
175 py::class_<Movable>(m, "Movable")
176 .def(py::init<int, int>());
177
178 // test_move_support
179#if !defined(__INTEL_COMPILER)
180 py::class_<NCVirt, NCVirtTrampoline>(m, "NCVirt")
181 .def(py::init<>())
182 .def("get_noncopyable", &NCVirt::get_noncopyable)
183 .def("get_movable", &NCVirt::get_movable)
184 .def("print_nc", &NCVirt::print_nc)
185 .def("print_movable", &NCVirt::print_movable);
186#endif
187
188 m.def("runExampleVirt", [](ExampleVirt *ex, int value) { return ex->run(value); });
189 m.def("runExampleVirtBool", [](ExampleVirt* ex) { return ex->run_bool(); });
190 m.def("runExampleVirtVirtual", [](ExampleVirt *ex) { ex->pure_virtual(); });
191
192 m.def("cstats_debug", &ConstructorStats::get<ExampleVirt>);
193 initialize_inherited_virtuals(m);
194
195 // test_alias_delay_initialization1
196 // don't invoke Python dispatch classes by default when instantiating C++ classes
197 // that were not extended on the Python side
198 struct A {
199 virtual ~A() {}
200 virtual void f() { py::print("A.f()"); }
201 };
202
203 struct PyA : A {
204 PyA() { py::print("PyA.PyA()"); }
205 ~PyA() { py::print("PyA.~PyA()"); }
206
207 void f() override {
208 py::print("PyA.f()");
209 PYBIND11_OVERLOAD(void, A, f);
210 }
211 };
212
213 py::class_<A, PyA>(m, "A")
214 .def(py::init<>())
215 .def("f", &A::f);
216
217 m.def("call_f", [](A *a) { a->f(); });
218
219 // test_alias_delay_initialization2
220 // ... unless we explicitly request it, as in this example:
221 struct A2 {
222 virtual ~A2() {}
223 virtual void f() { py::print("A2.f()"); }
224 };
225
226 struct PyA2 : A2 {
227 PyA2() { py::print("PyA2.PyA2()"); }
228 ~PyA2() { py::print("PyA2.~PyA2()"); }
229 void f() override {
230 py::print("PyA2.f()");
231 PYBIND11_OVERLOAD(void, A2, f);
232 }
233 };
234
235 py::class_<A2, PyA2>(m, "A2")
236 .def(py::init_alias<>())
237 .def("f", &A2::f);
238
239 m.def("call_f", [](A2 *a2) { a2->f(); });
240
241 // test_dispatch_issue
242 // #159: virtual function dispatch has problems with similar-named functions
243 py::class_<Base, DispatchIssue>(m, "DispatchIssue")
244 .def(py::init<>())
245 .def("dispatch", &Base::dispatch);
246
247 m.def("dispatch_issue_go", [](const Base * b) { return b->dispatch(); });
248
249 // test_override_ref
250 // #392/397: overridding reference-returning functions
251 class OverrideTest {
252 public:
253 struct A { std::string value = "hi"; };
254 std::string v;
255 A a;
256 explicit OverrideTest(const std::string &v) : v{v} {}
257 virtual std::string str_value() { return v; }
258 virtual std::string &str_ref() { return v; }
259 virtual A A_value() { return a; }
260 virtual A &A_ref() { return a; }
261 };
262
263 class PyOverrideTest : public OverrideTest {
264 public:
265 using OverrideTest::OverrideTest;
266 std::string str_value() override { PYBIND11_OVERLOAD(std::string, OverrideTest, str_value); }
267 // Not allowed (uncommenting should hit a static_assert failure): we can't get a reference
268 // to a python numeric value, since we only copy values in the numeric type caster:
269// std::string &str_ref() override { PYBIND11_OVERLOAD(std::string &, OverrideTest, str_ref); }
270 // But we can work around it like this:
271 private:
272 std::string _tmp;
273 std::string str_ref_helper() { PYBIND11_OVERLOAD(std::string, OverrideTest, str_ref); }
274 public:
275 std::string &str_ref() override { return _tmp = str_ref_helper(); }
276
277 A A_value() override { PYBIND11_OVERLOAD(A, OverrideTest, A_value); }
278 A &A_ref() override { PYBIND11_OVERLOAD(A &, OverrideTest, A_ref); }
279 };
280
281 py::class_<OverrideTest::A>(m, "OverrideTest_A")
282 .def_readwrite("value", &OverrideTest::A::value);
283 py::class_<OverrideTest, PyOverrideTest>(m, "OverrideTest")
284 .def(py::init<const std::string &>())
285 .def("str_value", &OverrideTest::str_value)
286// .def("str_ref", &OverrideTest::str_ref)
287 .def("A_value", &OverrideTest::A_value)
288 .def("A_ref", &OverrideTest::A_ref);
Jason Rhinelanderb3f3d792016-07-18 16:43:18 -0400289}
290
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400291
Jason Rhinelanderd6c365b2016-08-05 17:44:28 -0400292// Inheriting virtual methods. We do two versions here: the repeat-everything version and the
293// templated trampoline versions mentioned in docs/advanced.rst.
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400294//
Jason Rhinelanderd6c365b2016-08-05 17:44:28 -0400295// These base classes are exactly the same, but we technically need distinct
296// classes for this example code because we need to be able to bind them
297// properly (pybind11, sensibly, doesn't allow us to bind the same C++ class to
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400298// multiple python classes).
299class A_Repeat {
300#define A_METHODS \
301public: \
302 virtual int unlucky_number() = 0; \
Dean Moldovan99dbdc12016-08-19 13:45:36 +0200303 virtual std::string say_something(unsigned times) { \
304 std::string s = ""; \
305 for (unsigned i = 0; i < times; ++i) \
306 s += "hi"; \
307 return s; \
Jason Rhinelander20978262016-08-29 18:16:46 -0400308 } \
309 std::string say_everything() { \
310 return say_something(1) + " " + std::to_string(unlucky_number()); \
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400311 }
312A_METHODS
313};
314class B_Repeat : public A_Repeat {
315#define B_METHODS \
316public: \
317 int unlucky_number() override { return 13; } \
Dean Moldovan99dbdc12016-08-19 13:45:36 +0200318 std::string say_something(unsigned times) override { \
319 return "B says hi " + std::to_string(times) + " times"; \
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400320 } \
321 virtual double lucky_number() { return 7.0; }
322B_METHODS
323};
324class C_Repeat : public B_Repeat {
325#define C_METHODS \
326public: \
327 int unlucky_number() override { return 4444; } \
328 double lucky_number() override { return 888; }
329C_METHODS
330};
331class D_Repeat : public C_Repeat {
332#define D_METHODS // Nothing overridden.
333D_METHODS
334};
335
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400336// Base classes for templated inheritance trampolines. Identical to the repeat-everything version:
337class A_Tpl { A_METHODS };
338class B_Tpl : public A_Tpl { B_METHODS };
339class C_Tpl : public B_Tpl { C_METHODS };
340class D_Tpl : public C_Tpl { D_METHODS };
341
342
343// Inheritance approach 1: each trampoline gets every virtual method (11 in total)
344class PyA_Repeat : public A_Repeat {
345public:
346 using A_Repeat::A_Repeat;
347 int unlucky_number() override { PYBIND11_OVERLOAD_PURE(int, A_Repeat, unlucky_number, ); }
Dean Moldovan99dbdc12016-08-19 13:45:36 +0200348 std::string say_something(unsigned times) override { PYBIND11_OVERLOAD(std::string, A_Repeat, say_something, times); }
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400349};
350class PyB_Repeat : public B_Repeat {
351public:
352 using B_Repeat::B_Repeat;
353 int unlucky_number() override { PYBIND11_OVERLOAD(int, B_Repeat, unlucky_number, ); }
Dean Moldovan99dbdc12016-08-19 13:45:36 +0200354 std::string say_something(unsigned times) override { PYBIND11_OVERLOAD(std::string, B_Repeat, say_something, times); }
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400355 double lucky_number() override { PYBIND11_OVERLOAD(double, B_Repeat, lucky_number, ); }
356};
357class PyC_Repeat : public C_Repeat {
358public:
359 using C_Repeat::C_Repeat;
360 int unlucky_number() override { PYBIND11_OVERLOAD(int, C_Repeat, unlucky_number, ); }
Dean Moldovan99dbdc12016-08-19 13:45:36 +0200361 std::string say_something(unsigned times) override { PYBIND11_OVERLOAD(std::string, C_Repeat, say_something, times); }
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400362 double lucky_number() override { PYBIND11_OVERLOAD(double, C_Repeat, lucky_number, ); }
363};
364class PyD_Repeat : public D_Repeat {
365public:
366 using D_Repeat::D_Repeat;
367 int unlucky_number() override { PYBIND11_OVERLOAD(int, D_Repeat, unlucky_number, ); }
Dean Moldovan99dbdc12016-08-19 13:45:36 +0200368 std::string say_something(unsigned times) override { PYBIND11_OVERLOAD(std::string, D_Repeat, say_something, times); }
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400369 double lucky_number() override { PYBIND11_OVERLOAD(double, D_Repeat, lucky_number, ); }
370};
371
372// Inheritance approach 2: templated trampoline classes.
373//
374// Advantages:
375// - we have only 2 (template) class and 4 method declarations (one per virtual method, plus one for
376// any override of a pure virtual method), versus 4 classes and 6 methods (MI) or 4 classes and 11
377// methods (repeat).
378// - Compared to MI, we also don't have to change the non-trampoline inheritance to virtual, and can
379// properly inherit constructors.
380//
381// Disadvantage:
382// - the compiler must still generate and compile 14 different methods (more, even, than the 11
383// required for the repeat approach) instead of the 6 required for MI. (If there was no pure
384// method (or no pure method override), the number would drop down to the same 11 as the repeat
385// approach).
386template <class Base = A_Tpl>
387class PyA_Tpl : public Base {
388public:
389 using Base::Base; // Inherit constructors
390 int unlucky_number() override { PYBIND11_OVERLOAD_PURE(int, Base, unlucky_number, ); }
Dean Moldovan99dbdc12016-08-19 13:45:36 +0200391 std::string say_something(unsigned times) override { PYBIND11_OVERLOAD(std::string, Base, say_something, times); }
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400392};
393template <class Base = B_Tpl>
394class PyB_Tpl : public PyA_Tpl<Base> {
395public:
396 using PyA_Tpl<Base>::PyA_Tpl; // Inherit constructors (via PyA_Tpl's inherited constructors)
397 int unlucky_number() override { PYBIND11_OVERLOAD(int, Base, unlucky_number, ); }
Wenzel Jakob216df0d2016-08-12 00:59:57 +0200398 double lucky_number() override { PYBIND11_OVERLOAD(double, Base, lucky_number, ); }
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400399};
400// Since C_Tpl and D_Tpl don't declare any new virtual methods, we don't actually need these (we can
401// use PyB_Tpl<C_Tpl> and PyB_Tpl<D_Tpl> for the trampoline classes instead):
402/*
403template <class Base = C_Tpl> class PyC_Tpl : public PyB_Tpl<Base> {
404public:
405 using PyB_Tpl<Base>::PyB_Tpl;
406};
407template <class Base = D_Tpl> class PyD_Tpl : public PyC_Tpl<Base> {
408public:
409 using PyC_Tpl<Base>::PyC_Tpl;
410};
411*/
412
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400413
414void initialize_inherited_virtuals(py::module &m) {
Jason Rhinelander391c7542017-07-25 16:47:36 -0400415 // test_inherited_virtuals
416
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400417 // Method 1: repeat
Jason Rhinelander5fffe202016-09-06 12:17:06 -0400418 py::class_<A_Repeat, PyA_Repeat>(m, "A_Repeat")
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400419 .def(py::init<>())
420 .def("unlucky_number", &A_Repeat::unlucky_number)
Jason Rhinelander20978262016-08-29 18:16:46 -0400421 .def("say_something", &A_Repeat::say_something)
422 .def("say_everything", &A_Repeat::say_everything);
Jason Rhinelander6b52c832016-09-06 12:27:00 -0400423 py::class_<B_Repeat, A_Repeat, PyB_Repeat>(m, "B_Repeat")
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400424 .def(py::init<>())
425 .def("lucky_number", &B_Repeat::lucky_number);
Jason Rhinelander6b52c832016-09-06 12:27:00 -0400426 py::class_<C_Repeat, B_Repeat, PyC_Repeat>(m, "C_Repeat")
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400427 .def(py::init<>());
Jason Rhinelander6b52c832016-09-06 12:27:00 -0400428 py::class_<D_Repeat, C_Repeat, PyD_Repeat>(m, "D_Repeat")
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400429 .def(py::init<>());
430
Jason Rhinelander391c7542017-07-25 16:47:36 -0400431 // test_
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400432 // Method 2: Templated trampolines
Jason Rhinelander5fffe202016-09-06 12:17:06 -0400433 py::class_<A_Tpl, PyA_Tpl<>>(m, "A_Tpl")
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400434 .def(py::init<>())
435 .def("unlucky_number", &A_Tpl::unlucky_number)
Jason Rhinelander20978262016-08-29 18:16:46 -0400436 .def("say_something", &A_Tpl::say_something)
437 .def("say_everything", &A_Tpl::say_everything);
Jason Rhinelander6b52c832016-09-06 12:27:00 -0400438 py::class_<B_Tpl, A_Tpl, PyB_Tpl<>>(m, "B_Tpl")
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400439 .def(py::init<>())
440 .def("lucky_number", &B_Tpl::lucky_number);
Jason Rhinelander6b52c832016-09-06 12:27:00 -0400441 py::class_<C_Tpl, B_Tpl, PyB_Tpl<C_Tpl>>(m, "C_Tpl")
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400442 .def(py::init<>());
Jason Rhinelander6b52c832016-09-06 12:27:00 -0400443 py::class_<D_Tpl, C_Tpl, PyB_Tpl<D_Tpl>>(m, "D_Tpl")
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400444 .def(py::init<>());
445
Jason Rhinelander0ca96e22016-08-05 17:02:33 -0400446};
447