From 1cb5ff1dd54ecfad41711fc5a4ecf36d2ad8eaf6 Mon Sep 17 00:00:00 2001 From: Nick80835 <24271245+Nick80835@users.noreply.github.com> Date: Sat, 8 Feb 2025 19:23:12 -0500 Subject: [PATCH] Consider range list-like This allows you to pass range() to things such as get_messages as ids= without first explicitly converting it to a list. --- telethon/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/utils.py b/telethon/utils.py index 7f5e3e23..8f21df17 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -899,7 +899,7 @@ def is_list_like(obj): enough. Things like ``open()`` are also iterable (and probably many other things), so just support the commonly known list-like objects. """ - return isinstance(obj, (list, tuple, set, dict, GeneratorType)) + return isinstance(obj, (list, tuple, set, dict, range, GeneratorType)) def parse_phone(phone):