Compile iterable: iterable of schemas treated as allowed values

def _compile_iterable(self, schema):
        """ Compile iterable: iterable of schemas treated as allowed values """
        # Compile each member as a schema
        schema_type = type(schema)
        schema_subs = tuple(map(self.sub_compile, schema))

        # When the schema is an iterable with a single item (e.g. [dict(...)]),
        # Invalid errors from schema members should be immediately used.
        # This allows to report sane errors with `Schema([{'age': int}])`
        error_passthrough = len(schema_subs) == 1

        # Prepare self
        self.compiled_type = const.COMPILED_TYPE.ITERABLE
        self.name = _(u'{iterable_cls}[{iterable_options}]').format(
            iterable_cls=get_type_name(schema_type),
            iterable_options=_(u'|').join(x.name for x in schema_subs)
        )

        # Error partials
        err_type = self.Invalid(_(u'Wrong value type'), get_type_name(schema_type))
        err_value = self.Invalid(_(u'Invalid value'), self.name)

        # Validator
        def validate_iterable(l):
            # Type check
            if not isinstance(l, schema_type):
                # expected=<type>, provided=<type>
                raise err_type(provided=get_type_name(type(l)))

            # Each `v` member should match to any `schema` member
            errors = []  # Errors for every value
            values = []  # Sanitized values
            for value_index, value in list(enumerate(l)):
                # Walk through schema members and test if any of them match
                for value_schema in schema_subs:
                    try:
                        # Try to validate
                        values.append(value_schema(value))
                        break  # Success!
                    except signals.RemoveValue:
                        # `value_schema` commanded to drop this value
                        break
                    except Invalid as e:
                        if error_passthrough:
                            # Error-Passthrough enabled: add the original error
                            errors.append(e.enrich(path=[value_index]))
                            break
                        else:
                            # Error-Passthrough disabled: Ignore errors and hope other members will succeed better
                            pass
                else:
                    errors.append(err_value(get_literal_name(value), path=[value_index]))

            # Errors?
            if errors:
                raise MultipleInvalid.if_multiple(errors)

            # Typecast and finish
            return schema_type(values)

        # Matcher
        if self.matcher:
            return self._compile_callable(validate_iterable)  # Stupidly use it as callable

        return validate_iterable