mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-13 04:56:35 +03:00
Use classes when type hinting primitives
This commit is contained in:
parent
cb56c54351
commit
63ef7284f7
|
@ -120,8 +120,8 @@ def _write_modules(
|
||||||
for c in constructors)))
|
for c in constructors)))
|
||||||
|
|
||||||
imports = {}
|
imports = {}
|
||||||
primitives = ('int', 'long', 'int128', 'int256', 'string',
|
primitives = {'int', 'long', 'int128', 'int256', 'double',
|
||||||
'date', 'bytes', 'true')
|
'string', 'date', 'bytes', 'Bool', 'true'}
|
||||||
# Find all the types in other files that are used in this file
|
# Find all the types in other files that are used in this file
|
||||||
# and generate the information required to import those types.
|
# and generate the information required to import those types.
|
||||||
for t in tlobjects:
|
for t in tlobjects:
|
||||||
|
|
|
@ -170,9 +170,11 @@ class TLArg:
|
||||||
'long': 'int',
|
'long': 'int',
|
||||||
'int128': 'int',
|
'int128': 'int',
|
||||||
'int256': 'int',
|
'int256': 'int',
|
||||||
|
'double': 'float',
|
||||||
'string': 'str',
|
'string': 'str',
|
||||||
'date': 'Optional[datetime]', # None date = 0 timestamp
|
'date': 'Optional[datetime]', # None date = 0 timestamp
|
||||||
'bytes': 'bytes',
|
'bytes': 'bytes',
|
||||||
|
'Bool': 'bool',
|
||||||
'true': 'bool',
|
'true': 'bool',
|
||||||
}.get(cls, "'Type{}'".format(cls))
|
}.get(cls, "'Type{}'".format(cls))
|
||||||
if self.is_vector:
|
if self.is_vector:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user