John Posner <[email protected]> writes: > Q: Has anyone on the python-dev list ever proposed a "string"-module > function that does the job of the "in" operator? Maybe this: > > if test.contains(item) # would return a Boolean value
That's a string method, not a function in the string module. If you
want a function, use operator.contains:
>>> import operator
>>> operator.contains('foo', 'o')
True
--
http://mail.python.org/mailman/listinfo/python-list
