Python Gotcha's?

Arnaud Delobelle arnodel at gmail.com
Thu Apr 5 16:12:50 EDT 2012


On 5 April 2012 21:06, Emile van Sebille <emile at fenx.com> wrote:
> Kind of begs for a contains method that returns the appropriate boolean:
>
> if text.contains('bob')

It's already there:

    text.__contains__('bob')

It's usually spelt otherwise though:

    'bob' in text

-- 
Arnaud



More information about the Python-list mailing list