Skip to content

Commit

Permalink
Remove redundant import, show type instead TLObject on docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Jan 19, 2018
1 parent e3c56b0 commit 0e43022
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion telethon_generator/parser/tl_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def type_hint(self):
'date': 'datetime.datetime | None', # None date = 0 timestamp
'bytes': 'bytes',
'true': 'bool',
}.get(self.type, 'TLObject')
}.get(self.type, self.type)
if self.is_vector:
result = 'list[{}]'.format(result)
if self.is_flag and self.type != 'date':
Expand Down
9 changes: 0 additions & 9 deletions telethon_generator/tl_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,6 @@ def _write_init_py(out_dir, depth, namespace_tlobjects, type_constructors):
x for x in namespace_tlobjects.keys() if x
)))

# Import 'get_input_*' utils
# TODO Support them on types too
if 'functions' in out_dir:
builder.writeln(
'from {}.utils import get_input_peer, '
'get_input_channel, get_input_user, '
'get_input_media, get_input_photo'.format('.' * depth)
)

# Import 'os' for those needing access to 'os.urandom()'
# Currently only 'random_id' needs 'os' to be imported,
# for all those TLObjects with arg.can_be_inferred.
Expand Down

0 comments on commit 0e43022

Please sign in to comment.