Check all type from element in list in python : <p>What is the most elegant way for me to check element type from the list. I use all, isinstance and list comprehensive. but if there is more pythonic way to do it?</p>

<pre><code>from collections import Mapping
from enum import Enum
class Company(Enum):
    apple = 'Apple'
    google = 'Google'

a = {'key': 'xxxx'}
a = {'key': ({'sub_dic', 'value'})}
a = [Company.apple, Company.google]
if all(isinstance(i, Mapping) for i in a):
    print('dict')
elif all(isinstance(i, tuple) for i in a):
    if all(isinstance(i, Mapping) for i in a):
        print('tuple with dict')
    else:
        print('tuple')
elif all(isinstance(i, Enum) for i in a):
    print('Enum')
else
    print('Invalid type')

</code></pre>
