Skip to content

Commit 19661cf

Browse files
committed
🐛 Fix WalkableComponentMixin.__iter__
Signed-off-by: Paillat-dev <[email protected]>
1 parent dea292a commit 19661cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

discord/components/component.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,12 @@ class WalkableComponentMixin(ABC, Generic[C]):
119119
@abstractmethod
120120
def walk_components(self) -> Iterator[C]: ...
121121

122-
__iter__: Callable[[Self], Iterator[C]] = walk_components
122+
if TYPE_CHECKING:
123+
__iter__: Iterator[C]
124+
else:
125+
126+
def __iter__(self) -> Iterator[C]:
127+
yield from self.walk_components()
123128

124129
@abstractmethod
125130
def is_v2(self) -> bool: ...

0 commit comments

Comments
 (0)