From b0b332a2e0709649b91b7aa6dfc08622e7d67939 Mon Sep 17 00:00:00 2001 From: DA-344 <108473820+DA-344@users.noreply.github.com> Date: Wed, 30 Apr 2025 22:16:13 +0200 Subject: [PATCH] fix: Add/Modify View/Container.walk_children return types --- discord/ui/container.py | 2 +- discord/ui/view.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/discord/ui/container.py b/discord/ui/container.py index 4aad65ca4..a367c96e5 100644 --- a/discord/ui/container.py +++ b/discord/ui/container.py @@ -295,7 +295,7 @@ class Container(Item[V]): id=component.id, ) - def walk_children(self) -> Generator[Item[V], Any, None]: + def walk_children(self) -> Generator[Item[V], None, None]: """An iterator that recursively walks through all the children of this container and it's children, if applicable. diff --git a/discord/ui/view.py b/discord/ui/view.py index e7a17c2d7..2217474c5 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -30,6 +30,7 @@ from typing import ( ClassVar, Coroutine, Dict, + Generator, Iterator, List, Optional, @@ -585,7 +586,7 @@ class BaseView: """ return await self.__stopped - def walk_children(self): + def walk_children(self) -> Generator[Item[Any], None, None]: """An iterator that recursively walks through all the children of this view and it's children, if applicable.