[Python-ideas] Why is design-by-contracts not widely adopted?

Chris Angelico rosuav at gmail.com
Mon Oct 8 06:32:23 EDT 2018


On Mon, Oct 8, 2018 at 9:26 PM Steven D'Aprano <steve at pearwood.info> wrote:
> > 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.

Yet we keep having use-cases shown to us involving one person with one
module, and another person with another module, and the interaction
between the two. Which way is it? Do the contracts change frequently
or not? Are they public or not? How are we supposed to understand the
point of contracts if the use-cases being shown all involve bad code
and/or bad coding practices?

Contracts, apparently, allow people to violate versioning expectations
and feel good about it.

(Am I really exaggerating all that much here?)

ChrisA


More information about the Python-ideas mailing list