Commit ad882c4a authored by Patrick Snape's avatar Patrick Snape

Propagate equality operators through to Python

Easy change to allow comparisons on the Python side for
both rectangle and drectangle
parent ca568f54
......@@ -90,6 +90,8 @@ void bind_rectangles()
.def("intersect", &::intersect<type>, (arg("rectangle")))
.def("__str__", &::print_rectangle_str<type>)
.def("__repr__", &::print_rectangle_repr<type>)
.def(self == self)
.def(self != self)
.def_pickle(serialize_pickle<type>());
}
{
......@@ -112,6 +114,8 @@ void bind_rectangles()
.def("intersect", &::intersect<type>, (arg("rectangle")))
.def("__str__", &::print_rectangle_str<type>)
.def("__repr__", &::print_rectangle_repr<type>)
.def(self == self)
.def(self != self)
.def_pickle(serialize_pickle<type>());
}
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment