nineml.utility.filter_by_type

nineml.utility.filter_by_type(lst, acceptedtype)[source]

Find all the objects of a certain type in a list

This is a syntactic sugar function, which returns a list of all the objects in a iterable for which isinstance(o,acceptedtype) == True and for which the objects are not None. i.e:

filter_by_type([None], types.NoneType)
[]