bamthomas / aioimaplib

Python asyncio IMAP4rev1 client library
GNU General Public License v3.0
135 stars 58 forks source link

Typehints #61

Closed bamthomas closed 3 years ago

bamthomas commented 3 years ago

adds typehints.

The goal would be that we should avoid Optional or different types of data for functions. That is confusing and could lead to errors.

One thing that I've seen is that in Reponse, lines are str except for litteral binary that is bytes (we cannot encode it to a string). So maybe we could always use bytes for every lines. It was made out of strings because we thought at the time that this would be more convenient for the user. Finally, the drawback of having mixed types is more important, and converting bytes to str is quite easy.

What do you think ?

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 95.902% when pulling 2968004eaa71ffb5b5a228a3d193c67e35940d70 on typehints into 4d7b9a027e36c592f469aa4323c4c86c2dbd0703 on master.