#!/usr/local/bin/python2 class C(object): def __call__(self, a): return bool(a) print list(filter(C(), [0,330,9,0,5,8]))