Skip to content

Type hinting added for properties of Update object #1767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions telegram/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"""This module contains an object that represents a Telegram Update."""

from telegram import (Message, TelegramObject, InlineQuery, ChosenInlineResult,
CallbackQuery, ShippingQuery, PreCheckoutQuery, Poll)
CallbackQuery, ShippingQuery, PreCheckoutQuery, Poll, User, Chat)


class Update(TelegramObject):
Expand Down Expand Up @@ -105,7 +105,7 @@ def __init__(self,
self._id_attrs = (self.update_id,)

@property
def effective_user(self):
def effective_user(self) -> User:
"""
:class:`telegram.User`: The user that sent this update, no matter what kind of update this
is. Will be ``None`` for :attr:`channel_post` and :attr:`poll`.
Expand Down Expand Up @@ -141,7 +141,7 @@ def effective_user(self):
return user

@property
def effective_chat(self):
def effective_chat(self) -> Chat:
"""
:class:`telegram.Chat`: The chat that this update was sent in, no matter what kind of
update this is. Will be ``None`` for :attr:`inline_query`,
Expand Down Expand Up @@ -173,7 +173,7 @@ def effective_chat(self):
return chat

@property
def effective_message(self):
def effective_message(self) -> Message:
"""
:class:`telegram.Message`: The message included in this update, no matter what kind of
update this is. Will be ``None`` for :attr:`inline_query`,
Expand Down