py3 compatibility for filter