From 363e751f4896e4e29669723af84a8a175e8ee6ad Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 4 Mar 2018 00:23:13 +0100 Subject: [PATCH] Fix UserList not being considered a list --- telethon/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/telethon/utils.py b/telethon/utils.py index faf69649..a9311521 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -6,6 +6,7 @@ import math import mimetypes import re import types +from collections import UserList from mimetypes import add_type, guess_extension from .tl.types import ( @@ -342,7 +343,8 @@ 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, types.GeneratorType)) + return isinstance(obj, (list, tuple, set, dict, + UserList, types.GeneratorType)) def parse_phone(phone):