2011/2/28 Morten Wang <[email protected]>

> seenCategories = set();
> # then in my loop:
>   if not cat.title() in seenCategories:
>       seenCategories.add(cat.title());
>       # do something with this category
>
>
I think the "if" line is not necessary here because of definition of sets.
Just add.
I try to discover this part in pagegenerators. Either the script should
detect if a category comes for processing the second time and tell him not
to be so greedy, or it should detect the depth of recursion in an except
RuntimeError: and step back one.
_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to