mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-11-09 02:20:36 +00:00
Update code generator to emit type hints on init methods
This commit is contained in:
@@ -97,7 +97,7 @@ def parse_tl(file_path, layer, methods=None, ignored_ids=CORE_TYPES):
|
||||
if not line:
|
||||
continue
|
||||
|
||||
match = re.match('---(\w+)---', line)
|
||||
match = re.match(r'---(\w+)---', line)
|
||||
if match:
|
||||
following_types = match.group(1)
|
||||
is_function = following_types == 'functions'
|
||||
|
||||
@@ -174,7 +174,7 @@ class TLArg:
|
||||
'date': 'Optional[datetime]', # None date = 0 timestamp
|
||||
'bytes': 'bytes',
|
||||
'true': 'bool',
|
||||
}.get(cls, "Type{}".format(cls))
|
||||
}.get(cls, "'Type{}'".format(cls))
|
||||
if self.is_vector:
|
||||
result = 'List[{}]'.format(result)
|
||||
if self.is_flag and cls != 'date':
|
||||
|
||||
Reference in New Issue
Block a user