Created
October 18, 2012 04:16
-
-
Save GrahamDumpleton/3909828 to your computer and use it in GitHub Desktop.
Additional ObjectWrapper methods.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def __eq__(self, other): | |
| if isinstance(other, ObjectWrapper): | |
| return self._nr_last_object == other._nr_last_object | |
| return self._nr_last_object == other | |
| def __ne__(self, other): | |
| result = self.__eq__(other) | |
| if result is NotImplemented: | |
| return result | |
| return not result | |
| def __hash__(self): | |
| return hash(self._nr_last_object) | |
| def __str__(self): | |
| return str(self._nr_last_object) | |
| def __unicode__(self): | |
| return unicode(self._nr_last_object) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment