You can check for intersections of sets to see if a post has any of a number of tags. I use that in proofofbrian.
if c.is_main_post() and tracktags.intersection(post['tags']) and author not in notified:
You can check for intersections of sets to see if a post has any of a number of tags. I use that in proofofbrian.
if c.is_main_post() and tracktags.intersection(post['tags']) and author not in notified:
I will have a mess with this, otherwise it's back to looping!
tracktags is a set in that case. Otherwise I'd need nested loops to check all the combinations. I will use loops in some cases. I know there's a thing called 'code golf' where people try to implement something in as few characters as possible. That will end up with unreadable code. I try to make mine maintainable by others.
I remember this from the Perl days.. crazy!