Re: [BuildStream] Proposal: Consider adding type hints



Hi Chandan,

Thanks for writing this up, If anyone else, like me, has not
really seen this/had much experience with this before, I'd really
recommend reading this tutorial: [6]

On 2019-06-25 21:39, Chandan Singh wrote:
Hi all,

I wanted to start the conversation about adding type hints (as specified by PEP
484 [1]) to some parts of the BuildStream code.

Another +1 from me, I think it's a great idea.

The tutorial includes a "Pros and Cons" section [7] which I think strengthens
your proposal. There are no "Cons" listed here which I think provide
a good enough reason to reject this proposal.

Just bear in mind that we support >= python3.5, it seems that variable
annotations [8] e.g. `pi: float = 3.14159` were not introduced until
Python 3.6.


Thanks,
Chandan

Thanks,
James


[1]: https://www.python.org/dev/peps/pep-0484/
[2]: http://mypy-lang.org/
[3]: https://github.com/google/pytype
[4]: https://github.com/Microsoft/pyright
[5]:
https://gitlab.com/BuildStream/buildstream/commit/db4ace7c3addeacec9483651189516a4a5c16c67

[6] https://realpython.com/python-type-checking
[7] https://realpython.com/python-type-checking/#pros-and-cons
[8] https://realpython.com/python-type-checking/#variable-annotations




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]