Skip to content

Commit

Permalink
add list AnyNode to relevant type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownUser95 authored and anafvana committed Jul 27, 2024
1 parent e086958 commit f0459f0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pickpack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def get_selected_with_index(self) -> NodeWithIndex | list[NodeWithIndex]:
else:
return self.index_single_select()

def get_selected(self) -> AnyNode:
def get_selected(self) -> AnyNode | list[AnyNode]:
"""return the current selected option as a tuple: (option, index)
or as a list of tuples (in case multiselect is True)
"""
Expand Down Expand Up @@ -352,7 +352,7 @@ def draw(self, screen) -> None:

screen.refresh()

def run_loop(self, screen: window) -> AnyNode:
def run_loop(self, screen: window) -> AnyNode | list[AnyNode]:
while True:
self.draw(screen)
c: int = screen.getch()
Expand Down Expand Up @@ -382,16 +382,16 @@ def config_curses(self) -> None:
# Curses failed to initialize color support, eg. when TERM=vt100
curses.initscr()

def _start(self, screen: window) -> AnyNode:
def _start(self, screen: window) -> AnyNode | list[AnyNode]:
self.config_curses()
return self.run_loop(screen)

def start(self) -> AnyNode:
def start(self) -> AnyNode | list[AnyNode]:
"""Starts the interaction with the user"""
return curses.wrapper(self._start)


def pickpack(*args, **kwargs) -> AnyNode:
def pickpack(*args, **kwargs) -> AnyNode | list[AnyNode]:
"""Construct and start a :class:`PickPacker <PickPacker>`.
Usage::
Expand Down

0 comments on commit f0459f0

Please sign in to comment.