Skip to content

Commit

Permalink
Add missing type hints in _option_groups.py
Browse files Browse the repository at this point in the history
  • Loading branch information
janluke committed Jun 30, 2021
1 parent d4280dc commit 3f5dc2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cloup/_option_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ def options(self, options: Iterable[click.Option]) -> None:
def get_help_records(self, ctx: click.Context) -> List[Tuple[str, str]]:
if self.hidden:
return []
return [opt.get_help_record(ctx) for opt in self if not opt.hidden]
return [
opt.get_help_record(ctx) for opt in self if not opt.hidden # type: ignore
] # get_help_record() should return None only if opt.hidden

def option(self, *param_decls, **attrs) -> Callable[[F], F]:
"""Refer to :func:`cloup.option`."""
return option(*param_decls, group=self, **attrs)

def __iter__(self):
def __iter__(self) -> Iterator[click.Option]:
return iter(self.options)

def __getitem__(self, i: int) -> click.Option:
Expand Down

0 comments on commit 3f5dc2a

Please sign in to comment.