I am using python-3.2.3 64bit and see weird behavior.
Example using the interpreter: Input
>>> range(10)
leads to the conclusion
range(0, 10)
when should he print
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Symmetric input
>>> l = range(10) >>> f = filter( lambda x: x<2, l) >>> f
leads to exit
<filter object at 0x00000000033481D0>
but it should be
[0, 1]
Obviously, I can not do anything with this object:
>>>> len(f) Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> len(f) TypeError: object of type 'filter' has no len()
What is wrong here?
source share