Boolean (@Nullable PyType type) { if (type == null) { return null; } if (type instanceof PyUnionType) { return isUnionCallable((PyUnionType)type); } if (type instanceof PyCallableType) { return ((PyCallableType)type).isCallable(); } if (type instanceof PyStructuralType && ((PyStructuralType)type).isInferredFromUsages()) { return true; } if (type instanceof PyGenericType) { if (((PyGenericType)type).isDefinition()) { return true; } return isCallable(((PyGenericType)type).getBound()); } return false; }