Python iterating through list of lists of class objects, returns that object is not iterable? : I have an initial class:

    class foo:

        def __init__(self, a, b):
            self.a = a
            self.b = b
And another class which uses the foo class:

    class bar:

        def __init__(self, foos):
            self.foos = sorted(foos, key=attrgetter('a'))
where foos is a list of foo. I now want to take a list of list of foo, something that looks like

    lofoos = [[foo1, foo2, foo3], [foo4, foo5, foo6] ...]
and I want to use the map function to do this:

    list(map(lambda foos: bar(foos), lofoos))
But this returns the error: TypeError: iter() returned non-iterator of type 'foo'.  
Is there an easy solution to this?
    