Improve library typing#147
Conversation
i prefer |
| from mimetypes import MimeTypes | ||
| from pathlib import Path | ||
| from typing import Union, List, Optional, Callable, AsyncGenerator, Type, Tuple | ||
| from typing import Any, Union, List, Optional, Callable, AsyncGenerator, Type, Tuple, Optional |
| self, | ||
| value: Union[int, str, raw.types.RpcError] = None, | ||
| rpc_name: str = None, | ||
| value: Union[int, str, raw.types.RpcError, None] = None, |
There was a problem hiding this comment.
i think it should be Optional[Union[int, str, raw.types.RpcError]]
#130 was closed in favor of #151 that was merged today.
Again, should be a separate PR. You can also add
I don't quite think there's a way to do this via generics. But maybe there's a hack. Most probably it'd be a separate generator function that creates file with |
|
@CrisMystik why is it draft, though? |
|
@CrisMystik are you still willing to finish this? |
я живой? |
надеюсь. |
This pull request aims to improve Pyrogram/Kurigram's type hinting through the following changes:
Union[X, Y] = None, which is incorrect (it should beUnion[X, Y, None])Other changes that I still have not made:
Make allalready being worked on by feat(cod-gen): change raw types generation to have proper typehints #130 apparentlyraw.types.*classes inherit from their respectiveraw.base.*classes - and mark the latter as abstract classesdownload,get_users)invoke()using generics