Case-insensitive string compare?

Fredrik Lundh fredrik at pythonware.com
Fri Sep 5 08:30:44 CEST 2008


Maric Michaud wrote:

 > You''ll often see for loops written like this :
> 
> for i in (e for e in iterable if predicate(e)) :
>     ...

luckily, I don't.  most people, when faced with that problem, writes it 
in the obvious way:

    for i in iterable:
        if predicate(i):
            ...

to avoid an extra iterator and save typing.

</F>




More information about the Python-list mailing list