Skip to content

Commit

Permalink
Use vars instead of calling __dict__ magic method
Browse files Browse the repository at this point in the history
  • Loading branch information
cdown committed Dec 28, 2015
1 parent da08482 commit 3f2fe5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions srt.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def __init__(self, index, start, end, content, proprietary=''):
self.proprietary = proprietary

def __hash__(self):
return hash(frozenset(self.__dict__.items()))
return hash(frozenset(vars(self).items()))

def __eq__(self, other):
return self.__dict__ == other.__dict__
return vars(self) == vars(other)

def __lt__(self, other):
return self.start < other.start
Expand Down

0 comments on commit 3f2fe5b

Please sign in to comment.