Let's say you get the id from a HTML form as a string, and want to pass it to the library. Do you need to first convert it to an int? A uuid.UUID object? A custom ID class in the library? Is passing None allowed?
A type declaration on the get_product() function would tell you, and let the compiler to check your code for mistakes.
You look at code and you have no idea what is what. You have to be on your toes ALL THE TIME!
Even when you are editing a method on a class you cannot safely assume that all the properties will exist because someone can come along and create an instance of the class in a non-standard way such that a property you expect to always exist will not exist in that one situation.
shrug just document the interface and stick to it.
If you want to keep things simple, create data structures using namedtuple. You get really sane objects that are definitely POLA [1] compliant.
> You look at code and you have no idea what is what.
You should consider type hints [2] and/or docstrings [2].
[1] https://en.wikipedia.org/wiki/Principle_of_least_astonishmen...
I always use type hints when I write new code. Because 3.4 has no type hints for class member declarations I end up writing constructors that take parameters then assign them to self. This way PyCharm will properly detect the type of class members.