BuildStream-Migration-Bot opened a new issue #1388:
URL: https://github.com/apache/buildstream/issues/1388


   [See original issue on 
GitLab](https://gitlab.com/BuildStream/buildstream/-/issues/1388)
   In GitLab by [[Gitlab user @tristanvb]](https://gitlab.com/tristanvb) on Aug 
27, 2020, 13:42
   
   Since we started introducing the static type checking with `mypy`, we have 
been happily adding static type checking to the API surface, and now also 
internally.
   
   I have noticed that we use `List` in the codebase in a few places, and I 
think that we did this mostly lazily without considering other, more relaxed 
options, like `Sequence` or `Iterable`.
   
   In various cases, the API would be perfectly happy accepting a `Sequence` as 
an argument and not require that it actually be a `List` type, in these cases 
we should relax the type hints. Likewise with return values, we should avoid 
making a promise about a return value being a `List` when the API use cases 
would be satisfied with any `Sequence` or `Iterable`.
   
   I suggest that we do a passover review of the API annotations when we are 
closer to `2.0`, after an API freeze.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to