Further explain why we keep an internal list of buttons

This commit is contained in:
Dave Pearson
2023-02-20 14:27:08 +00:00
parent 063e815581
commit 54d59ef9af

View File

@@ -42,7 +42,11 @@ class RadioSet(Container):
# Build the internal list of buttons. Here, if we're given a
# RadioButton, we use it as-is; otherwise we spin one up from the
# given string.
# given string. We could, of course, just use the children property
# to do this as we're guaranteeing that everything within here is a
# RadioButton, but doing it this way makes subsequent type issues
# less of a problem *and* it's a guard against a developer doing a
# sneaky mount on us after the fact.
self._buttons = [
(button if isinstance(button, RadioButton) else RadioButton(button))
for button in buttons