Appendix: Functions in Module testEqual

These are the functions in module testEqual, which is used to help verify examples in this document.

isEmptyShape(a)

Test if shape a is empty. Return True if shape is empty, False otherwise. True is returned if a is None (not a shape) but False for other non-shapes.

areEqual(a, b)

Test if shapes a and b are equal. Return True or False. The main part of this test is based on the observation that a.cut(b) and b.cut(a)() should both be empty if the objects are equal. The first checks are just for the case where a or b is empty, causing cut to fail.

testEqual(a, b)

Check if shapes a and b are equal and raise an exception if they are not.

testNotEqual(a, b)

Check if shapes a and b are equal and raise an exception if they are.

isSubset(a, b)

Test if shape a is a subset of b. Return True or False. Equality is considered to be a subset (True is returned). A strict subset (non-equal) is based on the observation that a.cut(b) is not empty but b.cut(a) is empty. The first checks are just for case where a or b is empty, causing cut to fail.

testSubset(a, b)

Check if shape a is a (non-strict) subset of b and raise an exception if it is not.

testNotSubset(a, b)

Check if shape a is not a (non-strict) subset of b and raise an exception if it is.