Since these two lines are common, perhaps a little bit of refactoring: `__init__` could require a rule type and tree, and these class methods end with `return Rule(type, tree)`. That would also mean you couldn't create a rule in a broken state - at present, if you create `Rule(Rule.TYPE_INCLUDE)`, you get an instance that can't be used.

Also, while we're refactoring, let's pick a better name for the compiled rule - something like `expression_code` or `compiled_rule`.