'in' operator

Moshe Zadka moshez at zadka.site.co.il
Sun Feb 18 00:37:58 CET 2001


On Sat, 17 Feb 2001 16:35:28 GMT, jepler at inetnebr.com (Jeff Epler) wrote:

> However, I think that
> 	"" in "yY"
> and
> 	0 in "yY"
> should return 0, because for all items in "yY", none of them are
> "" or 0.  (This is compared to raising an error)

I thought so too, but when I offered to change, Guido didn't agree --
and he was probably was right.

Practicality beats purity -- and most times people do a ``0 in "yY"'' it's
an error, so Python signals it. For example, the recent poster, who was
lucky to have Python raise an error, rather then silently return 0.
-- 
"I'll be ex-DPL soon anyway so I'm        |LUKE: Is Perl better than Python?
looking for someplace else to grab power."|YODA: No...no... no. Quicker,
   -- Wichert Akkerman (on debian-private)|      easier, more seductive.
For public key, finger moshez at debian.org  |http://www.{python,debian,gnu}.org




More information about the Python-list mailing list