I am exploring an API, and using the following to see what methods are available without searching through all attributes by eye with
methods = [m for m in dir(kt) if callable(getattr(kt, m))]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/soco/core.py", line 103, in inner_function
soco.exceptions.SoCoSlaveException: The method or property "cross_fade" can only be called/used on the coordinator in a group
callable doesn't attempt to call the object. It only checks that the object has an implementation of the call operator.
The exception is occurring in the attempt to retrieve the attribute in the first place. Attribute access can be overridden to do just about anything in Python, and the
cross_fade attribute of this object is implemented as a
property with an
only_on_master decorator on the getter that raises an exception if you try to retrieve the attribute on a slave.