Most of the software developers that use the Python programming language do not specify the types of variables, parameters, and of the returned value when calling a function. Python is a Dynamic type programming language, and specifying these types does not change that. Nevertheless, if we choose to specify the types we will have the option of using a suitable static analysis tool to verify compatibility in terms of the types in each and every function call, and in each and every assignment of a value to a variable. This way, we can reduce the probability of bugs that arise from a mismatch in terms of types when passing over arguments to a function we call, and when assigning a value to a variable.
PEP 8 - Python's Official Style Guide
By specifying the types in our code, the quality of our code improves. It would be possible to use a static analysis tool for verifying that the types of arguments we pass over to a function match the types that were assigned to the function’s parameters. In addition, the very same static analysis tool will also verify that the type of every value assigned to a variable match the type of the variable. This is also the reason for the recommendation coming from PEP 8 to specify the types in the code we write.
The Types in Python Professional Seminar
We have recently completed the development of the Types in Python professional seminar. This seminar focuses on the use of types in Python in accordance with PEP 8, Python’s official style guide.
If you still don’t use types in your code it is about time to upgrade your programming skills and learn how to do it correctly.