From a869c54ecc55a3ef7fa13f2dac277528998567bb Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Tue, 19 Apr 2022 21:25:43 +0300 Subject: [PATCH] Removed unreachable code --- aiogram/dispatcher/filters/text.py | 8 +++----- aiogram/types/menu_button_commands.py | 5 ----- aiogram/types/menu_button_default.py | 5 ----- aiogram/types/message.py | 4 +--- aiogram/types/sent_web_app_message.py | 5 +---- aiogram/types/video_chat_scheduled.py | 4 ---- aiogram/types/video_chat_started.py | 5 ----- aiogram/types/web_app_data.py | 5 ----- aiogram/types/web_app_info.py | 5 ----- 9 files changed, 5 insertions(+), 41 deletions(-) diff --git a/aiogram/dispatcher/filters/text.py b/aiogram/dispatcher/filters/text.py index 3dd36fbd..09acb285 100644 --- a/aiogram/dispatcher/filters/text.py +++ b/aiogram/dispatcher/filters/text.py @@ -1,14 +1,12 @@ -from typing import TYPE_CHECKING, Any, Dict, Optional, Sequence, Union +from typing import Any, Dict, Optional, Sequence, Union from pydantic import root_validator from aiogram.dispatcher.filters import BaseFilter from aiogram.types import CallbackQuery, InlineQuery, Message, Poll +from aiogram.utils.i18n.lazy_proxy import LazyProxy -if TYPE_CHECKING: - from aiogram.utils.i18n.lazy_proxy import LazyProxy - -TextType = Union[str, "LazyProxy"] +TextType = Union[str, LazyProxy] class Text(BaseFilter): diff --git a/aiogram/types/menu_button_commands.py b/aiogram/types/menu_button_commands.py index 18452b70..5f4e252b 100644 --- a/aiogram/types/menu_button_commands.py +++ b/aiogram/types/menu_button_commands.py @@ -1,14 +1,9 @@ from __future__ import annotations -from typing import TYPE_CHECKING - from pydantic import Field from . import MenuButton -if TYPE_CHECKING: - pass - class MenuButtonCommands(MenuButton): """ diff --git a/aiogram/types/menu_button_default.py b/aiogram/types/menu_button_default.py index f4b60ea6..13cd3a37 100644 --- a/aiogram/types/menu_button_default.py +++ b/aiogram/types/menu_button_default.py @@ -1,14 +1,9 @@ from __future__ import annotations -from typing import TYPE_CHECKING - from pydantic import Field from . import MenuButton -if TYPE_CHECKING: - pass - class MenuButtonDefault(MenuButton): """ diff --git a/aiogram/types/message.py b/aiogram/types/message.py index a70feb64..1fe8a4f5 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -72,7 +72,7 @@ if TYPE_CHECKING: from .web_app_data import WebAppData -class _BaseMessage(TelegramObject): +class Message(TelegramObject): """ This object represents a message. @@ -198,8 +198,6 @@ class _BaseMessage(TelegramObject): reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. Inline keyboard attached to the message. :code:`login_url` buttons are represented as ordinary :code:`url` buttons.""" - -class Message(_BaseMessage): @property def content_type(self) -> str: if self.text: diff --git a/aiogram/types/sent_web_app_message.py b/aiogram/types/sent_web_app_message.py index dca1e5b7..7295382c 100644 --- a/aiogram/types/sent_web_app_message.py +++ b/aiogram/types/sent_web_app_message.py @@ -1,12 +1,9 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Optional +from typing import Optional from .base import TelegramObject -if TYPE_CHECKING: - pass - class SentWebAppMessage(TelegramObject): """ diff --git a/aiogram/types/video_chat_scheduled.py b/aiogram/types/video_chat_scheduled.py index c523fbff..541e988a 100644 --- a/aiogram/types/video_chat_scheduled.py +++ b/aiogram/types/video_chat_scheduled.py @@ -1,13 +1,9 @@ from __future__ import annotations from datetime import datetime -from typing import TYPE_CHECKING from .base import TelegramObject -if TYPE_CHECKING: - pass - class VideoChatScheduled(TelegramObject): """ diff --git a/aiogram/types/video_chat_started.py b/aiogram/types/video_chat_started.py index 595e889e..a6f9aed0 100644 --- a/aiogram/types/video_chat_started.py +++ b/aiogram/types/video_chat_started.py @@ -1,12 +1,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING - from .base import TelegramObject -if TYPE_CHECKING: - pass - class VideoChatStarted(TelegramObject): """ diff --git a/aiogram/types/web_app_data.py b/aiogram/types/web_app_data.py index 5a4b5b0a..6a108fef 100644 --- a/aiogram/types/web_app_data.py +++ b/aiogram/types/web_app_data.py @@ -1,12 +1,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING - from .base import TelegramObject -if TYPE_CHECKING: - pass - class WebAppData(TelegramObject): """ diff --git a/aiogram/types/web_app_info.py b/aiogram/types/web_app_info.py index f5d228f2..9317fae9 100644 --- a/aiogram/types/web_app_info.py +++ b/aiogram/types/web_app_info.py @@ -1,12 +1,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING - from .base import TelegramObject -if TYPE_CHECKING: - pass - class WebAppInfo(TelegramObject): """