Skip to content

Instantly share code, notes, and snippets.

@GrahamDumpleton
Created October 18, 2012 04:16
Show Gist options
  • Select an option

  • Save GrahamDumpleton/3909828 to your computer and use it in GitHub Desktop.

Select an option

Save GrahamDumpleton/3909828 to your computer and use it in GitHub Desktop.
Additional ObjectWrapper methods.
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