1
0
Fork 0
mirror of https://github.com/Findus23/new-github-changelog-generator.git synced 2024-08-27 19:52:18 +02:00
new-github-changelog-generator/generator/author.py

16 lines
433 B
Python

class Author:
def __init__(self, api: dict):
self.username = api["login"]
self.profile_url = api["html_url"]
def __repr__(self):
return "<Author '{}'>".format(self.username)
def __hash__(self):
return hash(self.username)
def __eq__(self, other):
if not isinstance(other, type(self)):
return NotImplemented
return self.username == other.username