python is not my native language.
You mean that I could write
if isinstance(a.arg, (GreaterThan, StrictGreaterThan, LessThan, StrictLessThan):
instead of
if a.arg.func in (GreaterThan, StrictGreaterThan, LessThan, StrictLessThan):

As I understand, it will make a difference if a.arg is a subclass of one of those.
Maybe you're right because it could handle more cases with the same code.
Or I could write
if isinstance(a.arg, (_Greater, _Less):
it is more concise (but those base classes seem somewhat private).