Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…ation
  • Loading branch information...
commit 3f07ac0e99ad9257b66d4366e4f6ef5f5a0e7c22 1 parent 2588678
@aht aht authored
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  MANIFEST
@@ -1,3 +1,4 @@
+LICENSE
README
setup.py
stream.py
View
5 MANIFEST.in
@@ -1,5 +1,2 @@
-README
-LICENSE
-setup.py
-stream.py
+include LICENSE
include example/*.py
View
2  setup.py
@@ -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
4 stream.py
@@ -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):
Please sign in to comment.
Something went wrong with that request. Please try again.