mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
iter states in states group (#666)
* iter states in states group * fix type hint * remove empty line * add changes for doc
This commit is contained in:
parent
714ac8896c
commit
90b3a99039
3 changed files with 13 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import inspect
|
||||
from typing import Any, Optional, Tuple, Type, no_type_check
|
||||
from typing import Any, Iterator, Optional, Tuple, Type, no_type_check
|
||||
|
||||
from ...types import TelegramObject
|
||||
|
||||
|
|
@ -118,6 +118,9 @@ class StatesGroupMeta(type):
|
|||
def __str__(self) -> str:
|
||||
return f"<StatesGroup '{self.__full_group_name__}'>"
|
||||
|
||||
def __iter__(self) -> Iterator[State]:
|
||||
return iter(self.__all_states__)
|
||||
|
||||
|
||||
class StatesGroup(metaclass=StatesGroupMeta):
|
||||
@classmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue