adafruit / Adafruit_CircuitPython_Requests

Requests-like interface for web interfacing
MIT License
51 stars 36 forks source link

Add type hints #87

Closed tekktrik closed 2 years ago

tekktrik commented 2 years ago

Probably the most complex typing PR I've done, so definitely would appreciate a thorough look from someone else @___@ I had to learn a few things for this one, so hopefully I implemented it all correctly!

tekktrik commented 2 years ago

Change # 1 - Changed to Union[bytes, bytearray] and also added the missing type hint for buf, but if there's a way to do _typing.ReadableBuffer that might be better. Don't know a lot about the other buffer types either so not sure whether this function should be accepting them either, but let me know if that makes more sense. Change # 2 - Added Change # 3 - Added Change # 4 - Left as bytearray for now but I'll change it if I misunderstood and that parameter can be of type bytes