gootsaud / bike-riding

hasattr used to check if the object is callable PTC-W0035
Bug risk
Major
2 years ago2 years old
hasattr used to check if the object is callable
 322
 323        # Allow callable classes to take a context
 324        if (
 325            hasattr(__obj, "__call__")  # noqa: B004 326            and _PassArg.from_obj(__obj.__call__) is not None  # type: ignore
 327        ):
 328            __obj = __obj.__call__  # type: ignore