Python package for building, comparing, annotating, manipulating and visualising trees. It provides a comprehensive API and a collection of command line tools, including utilities to work with the NCBI taxonomy tree.
This PR allows any callable object to be set as the layout function of a TreeStyle object.
Currently, only objects whose type match types.FunctionType or types.MethodType are allowed. This behavior excludes otherwise valid Python callables, e.g. partial functions created with functools.partial, or any used-defined class that implements __call__, irrespective of whether the actual call would succeed or not.
The PR fixes this by using the callable built-in function for checking the layout function's type.
This PR allows any callable object to be set as the layout function of a
TreeStyle
object.Currently, only objects whose type match
types.FunctionType
ortypes.MethodType
are allowed. This behavior excludes otherwise valid Python callables, e.g. partial functions created withfunctools.partial
, or any used-defined class that implements__call__
, irrespective of whether the actual call would succeed or not.The PR fixes this by using the
callable
built-in function for checking the layout function's type.