Is there a built-in function to determine if instance of a class exists in a list?
Currently I am doing it through a comprehension

>>> class A:
...     pass
...     
>>> l1=[5,4,3,A(),8]
>>> e=[e for e in l1 if isinstance(e,A)]
Edit
Report