Skip to content

Commit ef60465

Browse files
committed
-
1 parent e7b0907 commit ef60465

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

source_py2/python_toolbox/nifty_collections/lazy_tuple.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _with_lock(method, *args, **kwargs):
4949
return method(*args, **kwargs)
5050

5151

52-
@collections.Sequence.register
52+
5353
@comparison_tools.total_ordering
5454
class LazyTuple(collections.Sequence, object):
5555
'''
@@ -177,8 +177,8 @@ def __len__(self):
177177
if self.definitely_infinite:
178178
return 0 # Unfortunately infinity isn't supported.
179179
else:
180-
self.exhaust()
181-
return len(self.collected_data)
180+
self.exhaust()
181+
return len(self.collected_data)
182182

183183

184184
def __eq__(self, other):
@@ -281,6 +281,8 @@ def __hash__(self):
281281
if self.definitely_infinite:
282282
raise TypeError("An infinite `LazyTuple` isn't hashable.")
283283
else:
284-
self.exhaust()
285-
return hash(tuple(self))
286-
284+
self.exhaust()
285+
return hash(tuple(self))
286+
287+
288+
collections.Sequence.register(LazyTuple)

0 commit comments

Comments
 (0)