13 struct DoesNotSupportAsync {};
14 py::class_<DoesNotSupportAsync>(
m,
"DoesNotSupportAsync")
16 struct SupportsAsync {};
17 py::class_<SupportsAsync>(
m,
"SupportsAsync")
19 .def(
"__await__", [](
const SupportsAsync&
self) -> py::object {
20 static_cast<void>(
self);
21 py::object loop = py::module::import(
"asyncio.events").attr(
"get_event_loop")();
22 py::object
f = loop.attr(
"create_future")();
23 f.attr(
"set_result")(5);
24 return f.attr(
"__await__")();
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
TEST_SUBMODULE(async_module, m)