So that's 500 times faster, more Pythonic, and seems to actually answer the question one would want answered.
However, let's suppose there really is a reason to answer the question in the original code. Using more sensible basic datatypes, we only get about a 3x speedup:
In [4]:
rules = {thing.x for thing in get_rules()}
whatevers = {thing.x for thing in get_whatevers()}
for whatever in whatevers:
CPU times: user 18.3 s, sys: 96.9 ms, total: 18.4 s
I'm sure there is room for speedup if the actual problem being solved was better described. Maybe something involving itertools.product(), but it's hard to say without knowing what the correct behavior actually is.
Overall this is similar to saying you could implement bogosort in Python, and it would be much slower than calling Timsort with `sorted(my_stuff)`