The Python list comprehension syntax makes it easy to filter values within a comprehension. For example:
result = [x**2 for x in mylist if type(x) is int] <
There is the plain old use of a for loop to append to a list, too:
for
result = [] for x in mylist: expense = expensive(x) if expense: result.append(expense)