mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 17:36:34 +03:00
Fix None datetime being type hinted as invalid
This commit is contained in:
parent
0f10e1419f
commit
1593a4415e
|
@ -249,13 +249,13 @@ class TLArg:
|
||||||
'int': 'int',
|
'int': 'int',
|
||||||
'long': 'int',
|
'long': 'int',
|
||||||
'string': 'str',
|
'string': 'str',
|
||||||
'date': 'datetime.datetime',
|
'date': 'datetime.datetime | None', # None date = 0 timestamp
|
||||||
'bytes': 'bytes',
|
'bytes': 'bytes',
|
||||||
'true': 'bool',
|
'true': 'bool',
|
||||||
}.get(self.type, 'TLObject')
|
}.get(self.type, 'TLObject')
|
||||||
if self.is_vector:
|
if self.is_vector:
|
||||||
result = 'list[{}]'.format(result)
|
result = 'list[{}]'.format(result)
|
||||||
if self.is_flag:
|
if self.is_flag and self.type != 'date':
|
||||||
result += ' | None'
|
result += ' | None'
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in New Issue
Block a user