def _ensure_value_is_valid(self, value):
        """Ensure that value is a valid collection's value."""
        if not isinstance(value, self.__class__.value_type):
            raise TypeError('{0} is not valid collection value, instance '
                            'of {1} required'.format(
                                value, self.__class__.value_type))
        return value
Ensure that value is a valid collection's value.