Skip to content

Instantly share code, notes, and snippets.

@mohammadali66
Last active September 13, 2022 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohammadali66/cd4b24987f403fd65daab12e7749167c to your computer and use it in GitHub Desktop.
Save mohammadali66/cd4b24987f403fd65daab12e7749167c to your computer and use it in GitHub Desktop.
class Batch:
...
def __eq__(self, other):
if not isinstance(other, Batch):
return False
return other.reference == self.reference
def __hash__(self):
return hash(self.reference)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment