When you give pdist() a function (instead of a string), it confirms this by
checking that it's a "types.FunctionType". However, it is useful to be able to
provide a c-compiled function, which has type "types.BuiltinFunctionType".
Therefore, I suggest that
if mtype is types.FunctionType:
(on line 1079 in distance.py in revision 132) should be changed to :
if mtype in (types.FunctionType, types.BuiltinFunctionType):
or even
if hasattr(metric, '__call__'):
so as to allow any callable.
Original issue reported on code.google.com by jos...@hoersport.de on 10 Feb 2011 at 4:17
Original issue reported on code.google.com by
jos...@hoersport.de
on 10 Feb 2011 at 4:17