types.py #2366
coder2020official
started this conversation in
Ideas
types.py
#2366
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@Badiboy
I wanted to discuss types.py file, which is too big, with around 11k lines.
Additionally, I still have the idea of aliases for methods(e.g message.answer, with class Message having a few additional methods) in my mind.
So, I propose:
This will ensure that we no longer look through 11k lines but rather look for the necessary file in types folder.
Not only this will reduce mess but also create a base for future aliases.
This way, it will be easier to maintain and add aliases. We will directly add functions(e.g answer, answer_document, answer_photo, etc etc) to the necessary classes located in necessary files(e.g types/message.py).
However, a bigger question arises: if you are OK with a billion-file structure described above, and if we achieve it with no backward compatibility issues, and if I start implementing aliases, I will need your advice for backward compatibility for async version. When implementing aliases, I might need to separate types for async, or somehow implement both sync and async calls for method aliases(e.g Message.answer calling method either in async or in sync way)
Ofc this is all now a dream and will require lots of time and effort.
Just wanted to hear your opinion.
Beta Was this translation helpful? Give feedback.
All reactions