Question about None

Arnaud Delobelle arnodel at googlemail.com
Sun Jun 14 19:02:54 CEST 2009


Steven D'Aprano <steve at REMOVETHIS.cybersource.com.au> 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
   ...

-- 
Arnaud



More information about the Python-list mailing list