2
For some time I have studied and learned a little more about Python. I recently read an article about the description of python typing using the module typying
. Since I learned about this feature I try to improve the code by adding this feature in order to improve the documentation and also the maintenance.
A few days ago, with the addition of this resource, I came across a question about how best to describe a procedure. I imagined that by the knowledge I possess so far the best way would be the following.
def foo() -> None:
pass
But talking to a friend, I realized that this form might not be the best since because it is a procedure, we start from the definition that during the execution we will not return any object, not even the object None
.
Then comes the form already known:
def foo():
pass
that meets the desired objective of describing the procedure, but we still do not have a clear description that this function will be a procedure, therefore it will not return anything.
Even know a little more about an updated and complete form in terms of job description and procedure documentation?