(values, errmsg='negative value')
Iterate over values, failing if any are less than zero.
Iterate over values, failing if any are less than zero.
Iterate over values failing if any are less than zero .
def _fail_neg(values, errmsg='negative value'):
    """Iterate over values, failing if any are less than zero."""
    for x in values:
        if x < 0:
            raise StatisticsError(errmsg)
        yield x
def _fail_neg ( values , errmsg = 'negative value' ) : for x in values : if x < 0 : raise StatisticsError ( errmsg ) yield x