Question about None

Arnaud Delobelle arnodel at
Sun Jun 14 13:02:54 EDT 2009

Steven D'Aprano <steve at> writes:
> So-called "vacuous truth". It's often useful to have all([]) return true,
> but it's not *always* useful -- there are reasonable cases where the
> opposite behaviour would be useful:
> if all(the evidence points to the Defendant's guilt) then:
>     the Defendant is guilty
>     execute(the Defendant)
> sadly means that if there is no evidence that a crime has been committed,
> the person accused of committing the imaginary crime will be executed.

This is a bad example.  Someone is not convicted of a crime just because
all the available evidence points towards their guilt.  There may be
very little evidence altogether, or it might just be circumstancial, or
unconvincing.  Even though it may all point towards the defendent's
guilt, it doesn't mean they will be convicted.  There needs to be enough
evidence to convince the jury.  So it would be something like:

if sum(guilt_weight(e) for e in evidence) > GUILT_THRESHOLD:
   the defendant is guilty


More information about the Python-list mailing list