Avoid cyclic imports caused by #348 (fix #357)

This commit is contained in:
Lonami Exo
2017-10-24 10:07:31 +02:00
parent d58c729af0
commit b3ca68b7d9
3 changed files with 21 additions and 11 deletions

View File

@@ -104,8 +104,7 @@ class TLObject:
def class_name_for(typename, is_function=False):
"""Gets the class name following the Python style guidelines"""
# Courtesy of http://stackoverflow.com/a/31531797/4759433
result = re.sub(r'_([a-z])', lambda m: m.group(1).upper(),
typename)
result = re.sub(r'_([a-z])', lambda m: m.group(1).upper(), typename)
result = result[:1].upper() + result[1:].replace('_', '')
# If it's a function, let it end with "Request" to identify them
if is_function: