diff options
Diffstat (limited to 'include/gras/element.i')
-rw-r--r-- | include/gras/element.i | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/gras/element.i b/include/gras/element.i index dfe4852..ed21367 100644 --- a/include/gras/element.i +++ b/include/gras/element.i @@ -30,10 +30,17 @@ return ($self)->to_string(); } - bool __eq__(const Element &rhs) const + bool _equal(const Element &rhs) const { return ($self)->get() == rhs.get(); } + + %insert("python") + %{ + def __eq__(self, rhs): + if not isinstance(rhs, Element): return False + return self._equal(rhs) + %} } #endif /*INCLUDED_GRAS_ELEMENT_I*/ |