from operator import attrgetter


def iter_as_dict(itr):
    """Given an iterable, return a comprehension with the dict version of each element"""

    ag = attrgetter('dict')

    return [ ag(e) for e in itr if hasattr(e, 'dict') ]