Utility Classes :: IsCallable

Overview

The IsCallable utility class is used to specify that the object must be callable, that is, that callable(your_obj) returns True ([1 - 6]).

Usage example:

@returns(IsCallable())

This asserts that the return value must be invokable.

Details

The IsCallable() constructor accepts only the self parameter ([7]).

IsCallable instances will always compare equal (==) to one another ([8]).

References

  1. test_utility_classes.py: Test_IsCallable.test_builtins
  2. test_utility_classes.py: Test_IsCallable.test_newstyle_classes
  3. test_utility_classes.py: Test_IsCallable.test_oldstyle_classes
  4. test_utility_classes.py: Test_IsCallable.test_userdefined_functions
  5. test_utility_classes.py: Test_IsCallable.test_callable_instances_newstyle
  6. test_utility_classes.py: Test_IsCallable.test_callable_instances_oldstyle
  7. test_utility_classes.py: Test_IsCallable.test_accepts_no_args
  8. test_utility_classes.py: Test_IsCallable.test_equality

Valid XHTML 1.0 Transitional