Yes, my notice is half valid. The is necessary for the actions, not for storing. Anyway, not a big difference in efficiency. :-) I mean, adding to set works with a builtin "if" that is slightly faster than an interpreted if line, and anyway, it will be executed.

        if not cat.title() in seenCategories:
             # do something with this category