Question about ListView implementation #1667
-
I'm trying to build a radio input widget using the class ListView(Vertical, can_focus=True, can_focus_children=False):
...
class Selected(Message, bubble=True):
...
def __init__(self, sender: ListView, item: ListItem) -> None: # <-- NOTE
super().__init__(sender)
self.item: ListItem = item Please note that
I'm not a Python expert but I guess this makes some sense since the definition of the outer class (BTW, I mitigated this issue by changing the type of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Try this at the top of your file: from future import __annotations__ |
Beta Was this translation helpful? Give feedback.
Try this at the top of your file: