(self, types)
return expanded
Recursively look into composite types.

        Note: This returns a list. The list is ordered (by
        construction) by having simpler types first)
Recursively look into composite types.
Recursively look into composite types .
def expand_types(self, types):
        """Recursively look into composite types.

        Note: This returns a list. The list is ordered (by
        construction) by having simpler types first)
        """
        all_types = set()
        expanded = []
        stack = list(types)
        while stack:
            t = stack.pop()
            if t not in all_types:
                expanded.append(t)
                all_types.add(t)
            if t.arity > 0:
                for subtype in t.args:
                    if subtype not in all_types:
                        expanded.append(subtype)
                        all_types.add(subtype)
                        stack.append(subtype)
        expanded.reverse()
        return expanded
def expand_types ( self , types ) : all_types = set ( ) expanded = [ ] stack = list ( types ) while stack : t = stack . pop ( ) if t not in all_types : expanded . append ( t ) all_types . add ( t ) if t . arity > 0 : for subtype in t . args : if subtype not in all_types : expanded . append ( subtype ) all_types . add ( subtype ) stack . append ( subtype ) expanded . reverse ( ) return expanded