deepsourcestatus / test-repository

hasattr used to check if the object is callable PTC-W0035
Bug risk
Major
8 months ago8 months old
hasattr used to check if the object is callable
51    else:
52        converter = None
53
54    if hasattr(converter, "__call__"):55        return converter(value)
56
57    return value
hasattr used to check if the object is callable
153
154def wrong_callable():
155    number = ImaginaryNumber()
156    if hasattr(number, "__call__"):157        return number()
158
159