fix problem with list(bool)

"filter" was used as a varname, which caused 2->3 compatibility issues when filter was replaced with list(filter.