On 03/07/2020 11:15, Benjamin Schubert wrote:
> Hey everyone,
> 
> TLDR: I propose that we allow adding types anywhere in code if it is useful.
> 
> A few months ago, we moved towards annotating our public API with mypy 
> annotations [0].
> 
> I think it has overall gone well and also helped us catch a few problems.
> 
> The initial thought was to use it only for the public API and what was needed 
> to have mypy pass the checks.
> 
> One thing that I often end up doing for large refactors is adding types in 
> other places, and removing them
> before I make the MR, which I think is not an ideal workflow and could 
> benefit others.
> I would now propose that we move towards allowing adding types anywhere the 
> author think it is useful,
> this would also allow us to stop documenting the types in the docstrings and 
> only leverage type hints.
> 
> I do not mean by that that we should require type hints, rather that we 
> should accept them as long as they
> are correct and not causing problems.
> 
> Any thoughts on this?
> 
> Ben
> 
> [0] https://mail.gnome.org/archives/buildstream-list/2019-June/msg00043.html
> 

I've found myself doing similar things. I think improvements to documentation 
and additions of types can only be a positive change. Since the project is in a 
general state of development I can't see those sorts of changes as being 
controversial. Type annotations are very helpful for sanity checking api and 
saving time when reading code.

-- 
Best Regards,
Darius


For Codethink's privacy-policy please see 
https://www.codethink.co.uk/privacy.html

Reply via email to