From aade36dbd7c15c847977c3e822c5e1317648cc6e Mon Sep 17 00:00:00 2001 From: Lonami Date: Tue, 20 Feb 2018 16:45:23 +0100 Subject: [PATCH] Misleading docstring --- telethon/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/telethon/utils.py b/telethon/utils.py index 607897e4..d9e0e291 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -34,8 +34,10 @@ VALID_USERNAME_RE = re.compile(r'^[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]$') def get_display_name(entity): - """Gets the input peer for the given "entity" (user, chat or channel) - Returns None if it was not found""" + """ + Gets the display name for the given entity, if it's an ``User``, + ``Chat`` or ``Channel``. Returns an empty string otherwise. + """ if isinstance(entity, User): if entity.last_name and entity.first_name: return '{} {}'.format(entity.first_name, entity.last_name)