[pypy-issue] [issue1417] pipe operator does not work as overriden with pipe module

Jay Wren tracker at bugs.pypy.org
Mon Mar 11 14:33:37 CET 2013


Jay Wren <jrwren at xmtp.net> added the comment:

Closing this. My bad. I got an error which I assumed was pypy. I had just
changed to trying pypy. There must have been some other error. The pipe module
overrides the pipe operator as expected.

Python 2.7.3 (7e4f0faa3d51, Nov 21 2012, 15:59:46)
[PyPy 2.0.0-beta1 with GCC 4.2.1] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``happy PyPy's year 2010!''
>>>> import pipe
>>>> range(0,100) | pipe.select(lambda i: i%2==0)
<generator object <genexpr> at 0x000000010d5ce8e0>
>>>> range(0,100) | pipe.select(lambda i: i%2==0) | pipe.as_list
[True, False, True, False, True, False, True, False, True, False, True, False,
True, False, True, False, True, False, True, False, True, False, True, False,
True, False, True, False, True, False, True, False, True, False, True, False,
True, False, True, False, True, False, True, False, True, False, True, False,
True, False, True, False, True, False, True, False, True, False, True, False,
True, False, True, False, True, False, True, False, True, False, True, False,
True, False, True, False, True, False, True, False, True, False, True, False,
True, False, True, False, True, False, True, False, True, False, True, False,
True, False, True, False]
>>>> range(0,100) | pipe.where(lambda i: i%2==0) | pipe.as_list
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40,
42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80,
82, 84, 86, 88, 90, 92, 94, 96, 98]


Please, accept my apologies.

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1417>
________________________________________


More information about the pypy-issue mailing list