don't implicitly convert doubles to ints

This commit is contained in:
Wenzel Jakob
2016-05-17 15:35:29 +02:00
parent a439ccaa0e
commit 3f200fab22
5 changed files with 22 additions and 0 deletions

View File

@@ -104,4 +104,8 @@ void init_issues(py::module &m) {
// (no id): should not be able to pass 'None' to a reference argument
m2.def("print_element", [](ElementA &el) { std::cout << el.value() << std::endl; });
// (no id): don't cast doubles to ints
m2.def("expect_float", [](float f) { return f; });
m2.def("expect_int", [](int i) { return i; });
}