Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
- aiolimiter~=1.1,<1.3
- . # this basically does `pip install -e .`
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.16.1
rev: v1.18.1
hooks:
- id: mypy
name: mypy-ptb
Expand Down
5 changes: 5 additions & 0 deletions changes/unreleased/4949.YhMnQj57Qpm9HD5zkkhfZC.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
internal = "Update Mypy to v1.18.1"
[[pull_requests]]
uid = "4949"
author_uids = ["renovate[bot]"]
closes_threads = []
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ docs = [
linting = [
"pre-commit",
"ruff==0.12.7",
"mypy==1.16.1",
"mypy==1.18.1",
"pylint==3.3.8"
]
all = [{ include-group = "tests" }, { include-group = "docs" }, { include-group = "linting"}]
Expand Down
3 changes: 2 additions & 1 deletion src/telegram/_telegramobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from telegram import Bot

Tele_co = TypeVar("Tele_co", bound="TelegramObject", covariant=True)
Tele = TypeVar("Tele", bound="TelegramObject")


class TelegramObject:
Expand Down Expand Up @@ -457,7 +458,7 @@ def de_list(
return tuple(cls.de_json(d, bot) for d in data)

@contextmanager
def _unfrozen(self: Tele_co) -> Iterator[Tele_co]:
def _unfrozen(self: Tele) -> Iterator[Tele]:
"""Context manager to temporarily unfreeze the object. For internal use only.

Note:
Expand Down
4 changes: 2 additions & 2 deletions src/telegram/ext/_extbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def _insert_callback_data(self, obj: HandledTypes) -> HandledTypes:

if isinstance(obj, CallbackQuery):
self.callback_data_cache.process_callback_query(obj)
return obj # type: ignore[return-value]
return obj

if isinstance(obj, Message):
if obj.reply_to_message:
Expand All @@ -595,7 +595,7 @@ def _insert_callback_data(self, obj: HandledTypes) -> HandledTypes:

# Finally, handle the message itself
self.callback_data_cache.process_message(message=obj)
return obj # type: ignore[return-value]
return obj

if isinstance(obj, ChatFullInfo) and obj.pinned_message:
self.callback_data_cache.process_message(obj.pinned_message)
Expand Down
Loading
Loading