From 90a4510c78ecae63c087e076383e57ebfdfc9796 Mon Sep 17 00:00:00 2001 From: IdoKendo <41922392+IdoKendo@users.noreply.github.com> Date: Thu, 9 Mar 2023 17:03:59 +0200 Subject: [PATCH] [python-package] fix mypy errors about missing annotations and incompatible types (#5672) --- python-package/lightgbm/callback.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python-package/lightgbm/callback.py b/python-package/lightgbm/callback.py index 330bfd5c76a7..45f67edf5949 100644 --- a/python-package/lightgbm/callback.py +++ b/python-package/lightgbm/callback.py @@ -254,10 +254,10 @@ def __init__( self._reset_storages() def _reset_storages(self) -> None: - self.best_score = [] - self.best_iter = [] - self.best_score_list = [] - self.cmp_op = [] + self.best_score: List[float] = [] + self.best_iter: List[int] = [] + self.best_score_list: List[Union[_EvalResultTuple, None]] = [] + self.cmp_op: List[Callable[[float, float], bool]] = [] self.first_metric = '' def _gt_delta(self, curr_score: float, best_score: float, delta: float) -> bool: