From 4abb60fe0c7060db273cd11eb5ad402a2181bdee Mon Sep 17 00:00:00 2001 From: robertmartin8 Date: Tue, 19 Oct 2021 21:00:20 +0100 Subject: [PATCH] change lambda to callable in docs --- pypfopt/base_optimizer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pypfopt/base_optimizer.py b/pypfopt/base_optimizer.py index 6d28f87..4659ab6 100644 --- a/pypfopt/base_optimizer.py +++ b/pypfopt/base_optimizer.py @@ -337,10 +337,12 @@ class BaseConvexOptimizer(BaseOptimizer): ef.add_constraint(lambda x: x <= np.array([0.01, 0.08, ..., 0.5])) :param new_constraint: the constraint to be added - :type constraintfunc: lambda function + :type new_constraint: callable (e.g lambda function) """ if not callable(new_constraint): - raise TypeError("New constraint must be provided as a lambda function") + raise TypeError( + "New constraint must be provided as a callable (e.g lambda function)" + ) if self._opt is not None: raise exceptions.InstantiationError( "Adding constraints to an already solved problem might have unintended consequences. "