Permalink
Browse files

Use a list comprehension instead of calling `list` to force all evalu…

…ation
  • Loading branch information...
1 parent 2588678 commit 3f07ac0e99ad9257b66d4366e4f6ef5f5a0e7c22 @aht aht committed Dec 15, 2009
Showing with 5 additions and 7 deletions.
  1. +1 −0 MANIFEST
  2. +1 −4 MANIFEST.in
  3. +1 −1 setup.py
  4. +2 −2 stream.py
View
@@ -1,3 +1,4 @@
+LICENSE
README
setup.py
stream.py
View
@@ -1,5 +1,2 @@
-README
-LICENSE
-setup.py
-stream.py
+include LICENSE
include example/*.py
View
@@ -23,7 +23,7 @@
name = 'stream',
version = stream.__version__,
description = stream.__doc__.split('\n')[0],
- long_description = ''.join(open('stream.py').readlines()[2:106]),
+ long_description = ''.join(open('stream.py').readlines()[2:113]),
author = 'Anh Hai Trinh',
author_email = 'moc.liamg@hnirt.iah.hna:otliam'[::-1],
keywords='lazy iterable iterator generator stream data flow functional processing',
View
@@ -213,7 +213,7 @@ def __len__(self): ### this will force all evaluation
>>> Stream(range(20)) >> len
20
"""
- return len(list(self.iterator))
+ return len([i for i in self.iterator])
def __repr__(self):
return 'Stream(%s)' % repr(self.iterator)
@@ -301,7 +301,7 @@ def __pipe__(self, inpipe):
or (not self.slice.start and negative(self.slice.step)) \
or (not self.slice.stop and not negative(self.slice.step)):
# force all evaluation
- items = list(inpipe)
+ items = [i for i in inpipe]
else:
# force some evaluation
if negative(self.slice.step):

0 comments on commit 3f07ac0

Please sign in to comment.