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
- test_utility_classes.py: Test_IsCallable.test_builtins
- test_utility_classes.py: Test_IsCallable.test_newstyle_classes
- test_utility_classes.py: Test_IsCallable.test_oldstyle_classes
- test_utility_classes.py: Test_IsCallable.test_userdefined_functions
- test_utility_classes.py: Test_IsCallable.test_callable_instances_newstyle
- test_utility_classes.py: Test_IsCallable.test_callable_instances_oldstyle
- test_utility_classes.py: Test_IsCallable.test_accepts_no_args
- test_utility_classes.py: Test_IsCallable.test_equality