Fix None datetime being type hinted as invalid

This commit is contained in:
Lonami Exo 2017-09-23 20:07:40 +02:00
parent 0f10e1419f
commit 1593a4415e

View File

@ -249,13 +249,13 @@ class TLArg:
'int': 'int',
'long': 'int',
'string': 'str',
'date': 'datetime.datetime',
'date': 'datetime.datetime | None', # None date = 0 timestamp
'bytes': 'bytes',
'true': 'bool',
}.get(self.type, 'TLObject')
if self.is_vector:
result = 'list[{}]'.format(result)
if self.is_flag:
if self.is_flag and self.type != 'date':
result += ' | None'
return result