String compare question

Robert Dailey rcdailey at gmail.com
Mon Feb 25 12:16:31 EST 2008


On Mon, Feb 25, 2008 at 10:49 AM, Gary Herron <gherron at islandtraining.com>
wrote:
>
> You expect this is creating a tuple (or so I see from your "in" test in
> the following code), but in fact the parenthesis do *not* make a tuple.
> If you look at ignored_dirs, you'll find it's just a string.  It's the
> presence of commas that signam a tuple.  You need
>
> ignored_dirs = (
>    r".\boost\include",  # It's that comma that makes this a tuple.
>     )
>

Thanks for reminding me of this. I always forget that!

Now that it is correctly doing *only* whole string matches, what if I want
to make it do a substring compare to each string in my ignored_dirs tuple?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080225/2e29aa91/attachment-0001.html>


More information about the Python-list mailing list