def _validate(self, val: list, log: Optional[Logger] = None) -> Tuple[bool, List[str]]:
        """ Determine whether val is a valid instance of this array

        :returns: Success indicator and error list """
        errors = []
        if not isinstance(val, list):
            errors.append(f"{self._variable_name}: {repr(val)} is not an array")
        else:
            for i in range(0, len(val)):
                v = val[i]
                if not conforms(v, self._type, self._context.NAMESPACE):
                    errors.append(f"{self._variable_name} element {i}: {v} is not a {self._type.__name__}")

            if len(val) < self._min:
                errors.append(
                    f"{self._variable_name}: at least {self._min} value{'s' if self._min > 1 else ''} required - "
                    f"element has {len(val) if len(val) else 'none'}")
            if self._max is not None and len(val) > self._max:
                errors.append(
                    f"{self._variable_name}: no more than {self._max} values permitted - element has {len(val)}")

        if log:
            for error in errors:
                log.log(error)
        return not bool(errors), errors
def _validate ( self , val : list , log : Optional [ Logger ] = None ) -> Tuple [ bool , List [ str ] ] : errors = [ ] if not isinstance ( val , list ) : errors . append ( f"{self._variable_name}: {repr(val)} is not an array" ) else : for i in range ( 0 , len ( val ) ) : v = val [ i ] if not conforms ( v , self . _type , self . _context . NAMESPACE ) : errors . append ( f"{self._variable_name} element {i}: {v} is not a {self._type.__name__}" ) if len ( val ) < self . _min : errors . append ( f"{self._variable_name}: at least {self._min} value{'s' if self._min > 1 else ''} required - " f"element has {len(val) if len(val) else 'none'}" ) if self . _max is not None and len ( val ) > self . _max : errors . append ( f"{self._variable_name}: no more than {self._max} values permitted - element has {len(val)}" ) if log : for error in errors : log . log ( error ) return not bool ( errors ) , errors
Determine whether val is a valid instance of this array

        :returns: Success indicator and error list