Closed fpreiss closed 2 weeks ago
@fpreiss Absolutely type hints should be everywhere even if python runtime ignores them. I would encourage adding accurate type-hints everywhere you see fit. I have been doing the same for sglang codes that I come across to refactor or change.
The given type annotations in python/sglang/api.py should probably be typed as
Optional
.Bonus Question: Generally the code base uses type annotations in most situations (which I personally enjoy working with). When reading through the examples however I find it a little bit harder to understand what kind of objects are passed around. Is there an interest in having type annotations added to the example code? I know that its not everybody's preference.