Ensure selection casting works in earlier Pythons

This commit is contained in:
Dave Pearson
2023-05-22 13:20:49 +01:00
parent 127d93a260
commit 1d925da551

View File

@@ -203,11 +203,11 @@ class SelectionList(Generic[SelectionType], OptionList):
"""
if len(selection) == 3:
label, value, selected = cast(
tuple[TextType, SelectionType, bool], selection
"tuple[TextType, SelectionType, bool]", selection
)
elif len(selection) == 2:
label, value, selected = cast(
tuple[TextType, SelectionType, bool], (*selection, False)
"tuple[TextType, SelectionType, bool]", (*selection, False)
)
else:
# TODO: Proper error.