list index()

Carsten Haese carsten at uniqsys.com
Fri Aug 31 03:15:27 CEST 2007


On Fri, 2007-08-31 at 12:57 +1200, Lawrence D'Oliveiro wrote:
> In message <mailman.158.1188499243.28954.python-list at python.org>, Steve
> Holden wrote:
> 
> > But why would you want to ignore built-in support like "value in dict"?
> 
> Because a function can be passed as a value in its own right, a built-in
> construct cannot.

...and that's why we have operator.contains():

>>> import operator
>>> help(operator.contains)
Help on built-in function contains in module operator:

contains(...)
    contains(a, b) -- Same as b in a (note reversed operands).

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list