>>> always_testable(IsInstance(Add(Local('a'),Local('b')))) |
>>> always_testable(IsInstance(Add(Local('a'),Local('b')))) |
False |
False |
|
|
>>> always_testable(IsSubclass(Local('x'))) |
|
True |
|
>>> always_testable(IsSubclass(Add(Local('a'),Local('b')))) |
|
False |
|
|
|
>>> always_testable(Comparison(Local('x'))) |
>>> always_testable(Comparison(Local('x'))) |
True |
True |
>>> always_testable(Comparison(Add(Local('a'),Local('b')))) |
>>> always_testable(Comparison(Add(Local('a'),Local('b')))) |
>>> always_testable(Truth(Add(Local('a'),Local('b')))) |
>>> always_testable(Truth(Add(Local('a'),Local('b')))) |
False |
False |
|
|
|
Except for ``IsSubclass()``, which may need to have other tests applied before |
|
it:: |
|
|
|
>>> always_testable(IsSubclass(Local('x'))) |
|
False |
|
|
If you create a new predicate type, be sure to define a method for |
If you create a new predicate type, be sure to define a method for |
``always_testable`` that will recursively invoke ``always_testable`` on the |
``always_testable`` that will recursively invoke ``always_testable`` on the |
predicate's target expression. If you don't do this, then your predicate |
predicate's target expression. If you don't do this, then your predicate |