Skip to content

Commit

Permalink
[python-package] add type hints on empty initializations (#5445)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Aug 30, 2022
1 parent 465989f commit 71b6550
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions python-package/lightgbm/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2514,7 +2514,7 @@ def get_ref_chain(self, ref_limit: int = 100) -> Set["Dataset"]:
Chain of references of the Datasets.
"""
head = self
ref_chain = set()
ref_chain: Set[Dataset] = set()
while len(ref_chain) < ref_limit:
if isinstance(head, Dataset):
ref_chain.add(head)
Expand Down Expand Up @@ -2733,8 +2733,8 @@ def __init__(
ctypes.byref(self.handle)))
# save reference to data
self.train_set = train_set
self.valid_sets = []
self.name_valid_sets = []
self.valid_sets: List[Dataset] = []
self.name_valid_sets: List[str] = []
self.__num_dataset = 1
self.__init_predictor = train_set._predictor
if self.__init_predictor is not None:
Expand Down
2 changes: 1 addition & 1 deletion python-package/lightgbm/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def __init__(
model_file : str, pathlib.Path or None, optional (default=None)
Path to the CVBooster model file.
"""
self.boosters = []
self.boosters: List[Booster] = []
self.best_iteration = -1

if model_file is not None:
Expand Down

0 comments on commit 71b6550

Please sign in to comment.