> In other words, you change the *public interface* of your functions
> all the time? How do you not have massive breakage all the time?
I can't comment about Marko's actual use-case, but *in general*
contracts are aimed at application *internal* interfaces, not so much
library *public* interfaces.
Sorry, I might have misunderstood the question -- I was referring to modules used within the company, not outside. Of course, public libraries put on pypi don't change their interfaces weekly.
Just to clear the confusion, both Steve and I would claim that the contracts do count as part of the interface.
For everything internal, we make changes frequently (including the interface) and more often than not, the docstring is not updated when the implementation of the function is. Contracts help our team catch breaking changes more easily. When we change the behavior of the function, we use "Find usage" in Pycharm, fix manually what we can obviously see that was affected by the changed implementation, then statically check with mypy that the changed return type did not affect the callers, and contracts (of other functions!) catch some of the bugs during testing that we missed when we changed the implementation. End-to-end test with testing contracts turned off catch some more bugs on the real data, and then it goes into production where hopefully we see no errors.