'Append an element to values'

def append_element(self, *args, **kwargs):

    assert ((not self._ready) or isinstance(self._values, list)), ('_CallbackResult    state    is    incompatible    with    append_element:    ready=%r;    values=%r' % (self._ready, self._values))
    try:
        value = self._value_class(*args, **kwargs)
    except Exception:
        LOGGER.error('append_element    failed:    value_class=%r;    args=%r;    kwargs=%r', self._value_class, args, kwargs)
        raise
    if (self._values is None):
        self._values = [value]
    else:
        self._values.append(value)
    self._ready = True
