mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Deprecate handle::operator== in favor of object_api::is
This commit is contained in:
@@ -37,7 +37,7 @@ test_initializer eval([](py::module &m) {
|
||||
);
|
||||
auto x = local["x"].cast<int>();
|
||||
|
||||
return result == py::none() && x == 42;
|
||||
return result.is_none() && x == 42;
|
||||
});
|
||||
|
||||
m.def("test_eval", [global]() {
|
||||
@@ -55,7 +55,7 @@ test_initializer eval([](py::module &m) {
|
||||
|
||||
auto result = py::eval<py::eval_single_statement>("x = call_test()", py::dict(), local);
|
||||
auto x = local["x"].cast<int>();
|
||||
return result == py::none() && x == 42;
|
||||
return result.is_none() && x == 42;
|
||||
});
|
||||
|
||||
m.def("test_eval_file", [global](py::str filename) {
|
||||
@@ -66,7 +66,7 @@ test_initializer eval([](py::module &m) {
|
||||
local["call_test2"] = py::cpp_function([&](int value) { val_out = value; });
|
||||
|
||||
auto result = py::eval_file(filename, global, local);
|
||||
return val_out == 43 && result == py::none();
|
||||
return val_out == 43 && result.is_none();
|
||||
});
|
||||
|
||||
m.def("test_eval_failure", []() {
|
||||
|
||||
Reference in New Issue
Block a user