Utility Classes :: IsOneOf

Overview

The IsOneOf class is used to specify that the object must be an instance of any number of types or user-defined classes, or be validated by other extension classes [1].

The IsOneOf() constructor must be passed at least two ([2]) distinct ([3]) types, user-defined classes or registered extension classes. For example:

IsOneOf(int, FooClass, IsAllof(ClassA, ClassB))

Where FooClass is either a old- or new-style class, and IsAllOf is the IsAllOf() utility class.

The requirement that there are two distinct conditions stems from the fact that the following call is almost certainly an error:

IsOneOf(int, int)

Details

References

  1. test_utility_classes.py: Test_Or.test_success
  2. test_utility_classes.py: Test_Or.test_constructor
  3. test_utility_classes.py: Test_Or.test_distinct_parameters
  4. test_utility_classes.py: Test_Or.test_failure
  5. test_utility_classes.py: Test_Or.test_equality
  6. test_utility_classes.py: Test_Or.test_hash

Valid XHTML 1.0 Transitional