Skip to content

Commit 3bd79af

Browse files
committed
Utilize __slots__ instead of enumerating all the keys
1 parent c9dc438 commit 3bd79af

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sourcemap/objects.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ def __unicode__(self):
3737
return unicode(self.name)
3838

3939
def __eq__(self, other):
40-
keys = ('dst_line', 'dst_col', 'src', 'src_line', 'src_col', 'name')
41-
for key in keys:
40+
for key in self.__slots__:
4241
if getattr(self, key) != getattr(other, key):
4342
return False
4443
return True

0 commit comments

Comments
 (0)