Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

list index()


  • From: carsten at uniqsys.com (Carsten Haese)
  • Subject: list index()
  • Date: Thu, 30 Aug 2007 21:15:27 -0400

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