From 63ef7284f7e1fbda8afccfda366c0302d7843c48 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Thu, 2 May 2019 19:12:11 +0200 Subject: [PATCH] Use classes when type hinting primitives --- telethon_generator/generators/tlobject.py | 4 ++-- telethon_generator/parsers/tlobject/tlarg.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/telethon_generator/generators/tlobject.py b/telethon_generator/generators/tlobject.py index d6b5c4b8..1636a944 100644 --- a/telethon_generator/generators/tlobject.py +++ b/telethon_generator/generators/tlobject.py @@ -120,8 +120,8 @@ def _write_modules( for c in constructors))) imports = {} - primitives = ('int', 'long', 'int128', 'int256', 'string', - 'date', 'bytes', 'true') + primitives = {'int', 'long', 'int128', 'int256', 'double', + 'string', 'date', 'bytes', 'Bool', 'true'} # Find all the types in other files that are used in this file # and generate the information required to import those types. for t in tlobjects: diff --git a/telethon_generator/parsers/tlobject/tlarg.py b/telethon_generator/parsers/tlobject/tlarg.py index 5dcb3743..a0593c4a 100644 --- a/telethon_generator/parsers/tlobject/tlarg.py +++ b/telethon_generator/parsers/tlobject/tlarg.py @@ -170,9 +170,11 @@ class TLArg: 'long': 'int', 'int128': 'int', 'int256': 'int', + 'double': 'float', 'string': 'str', 'date': 'Optional[datetime]', # None date = 0 timestamp 'bytes': 'bytes', + 'Bool': 'bool', 'true': 'bool', }.get(cls, "'Type{}'".format(cls)) if self.is_vector: