mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 17:36:34 +03:00
Don't generate def resolve() for types
This would require nested resolving which could be quite expensive. Instead there will just be a single level for resolve() and it will belong in the requests.
This commit is contained in:
parent
bb4ed4019f
commit
5d4b8a283d
|
@ -233,7 +233,8 @@ def _write_class_init(tlobject, kind, type_constructors, builder):
|
||||||
|
|
||||||
|
|
||||||
def _write_resolve(tlobject, builder):
|
def _write_resolve(tlobject, builder):
|
||||||
if any(arg.type in AUTO_CASTS for arg in tlobject.real_args):
|
if tlobject.is_function and\
|
||||||
|
any(arg.type in AUTO_CASTS for arg in tlobject.real_args):
|
||||||
builder.writeln('async def resolve(self, client, utils):')
|
builder.writeln('async def resolve(self, client, utils):')
|
||||||
for arg in tlobject.real_args:
|
for arg in tlobject.real_args:
|
||||||
ac = AUTO_CASTS.get(arg.type, None)
|
ac = AUTO_CASTS.get(arg.type, None)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user