Neatest way to do a case insensitive "in"?

Jervis Whitley jervisau at gmail.com
Thu Mar 19 19:16:02 EDT 2009


>
> I agree that it's an alternative. There are a number of alternatives.
> However the OP was asking for a "neater/easier" alternative. I argue
> that introducing an external module/function to do the exact same thing
> as a built-in type's method doesn't exactly qualify as a "neater/easier"
> alternative.

I argue that it is this functional approach looks visually clean and
hence may appeal
to a readers sense of "neatness" or aesthetics. No one is right or
wrong in this case,
they are both fine solutions.

> In fact, unless you are using a *very* old version of python, if you
> look at the implementation of string.lower(s) it simply returns
> s.lower().



More information about the Python-list mailing list