Skip to content

Instantly share code, notes, and snippets.

@iktakahiro
Created March 7, 2021 09:35
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 iktakahiro/67c15cc23994bb5a1bbcfeae58b9eefb to your computer and use it in GitHub Desktop.
Save iktakahiro/67c15cc23994bb5a1bbcfeae58b9eefb to your computer and use it in GitHub Desktop.
class Book:
def __init__(self, id: str, title: str):
self.id: str = id
self.title: str = title
def __eq__(self, o: object) -> bool:
if isinstance(o, Book):
return self.id == o.id
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment