Usefulness of the "not in" operator

Roy Smith roy at panix.com
Sat Oct 8 21:41:03 EDT 2011


In article <mailman.1841.1318123788.27778.python-list at python.org>,
 Chris Angelico <rosuav at gmail.com> wrote:

> I sent this email twelve hours ago but to the wrong mailing list
> *blush*. Since nobody else has raised the point, I'll repost it.
> 
> On Sun, Oct 9, 2011 at 12:07 AM, Jussi Piitulainen
> <jpiitula at ling.helsinki.fi> wrote:
> > But both negations can be avoided by modus tollens.
> >
> > "If you are able to start the car, the key is in the ignition."
> >
> 
> But this translation implies looking at the result and ascertaining
> the state, which is less appropriate to a programming language. It's
> more like:
> 
> "If you found that you were able to start the car, the key must have
> been in the ignition."
> 
> and is thus quite inappropriate to the imperative style. A functional
> language MAY be able to use this style, but Python wants to have the
> condition and then the action.
> 
> ChrisA

The key is in the ignition if you are able to start the car else you 
hot-wired it.



More information about the Python-list mailing list