not in

Bernhard Herzog bh at intevation.de
Mon Jan 21 22:10:49 CET 2002


rihad <rihad at mail.ru> writes:

> If it's all about readability, Python should require `is' after `if',
> as in if x is in sequence

In this particular case, I'd say that "x is in sequence" works like "x
in sequence" except that it doesn't test objects for equality but
identity, in analogy to "==" vs "is".

"x is in sequence" is actually something that I sometimes thought would
be a useful addition to python. This is a test I use in Sketch in some
places. However, it's rarely needed and it's simple enough to write a
C-function that implements this.

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                               http://mapit.de/



More information about the Python-list mailing list