>>> n = [1,2,3,4] >>> filter(lambda x:x>3,n) >>> len(filter(lambda x:x>3,n)) Traceback
Converting a filter to a list will take extra memory, which may not be acceptable for large amounts of data. You can find length of the filter object without converting it to a list:
sum(1 for _ in filter(lambda x: x > 3, n))