khazhyk / osuapi

Simple osu api wrapper that I can use with both requests and aiohttp
http://osuapi.readthedocs.io/en/latest/index.html
MIT License
16 stars 8 forks source link

hash and eq for SoloScore based on score_id? #29

Closed YaLTeR closed 5 years ago

YaLTeR commented 5 years ago

I needed to store scores in a set, so I added this to SoloScore:

    def __hash__(self):
        return hash(self.score_id)

    def __eq__(self, other):
        return self.score_id == other.score_id

which works as it should for my purposes. Would a PR with that be fine, or is this too specific to my use-case?

khazhyk commented 5 years ago

seems fine

khazhyk commented 5 years ago

66b83cc785bb1c550b93d8556ceb0e2e7f068f5a