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.
Coverage remained the same at 95.902% when pulling 2968004eaa71ffb5b5a228a3d193c67e35940d70 on typehints into 4d7b9a027e36c592f469aa4323c4c86c2dbd0703 on master.
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 arestr
except for litteral binary that isbytes
(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 ?