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

Chris Angelico rosuav at gmail.com
Tue Sep 25 15:40:45 EDT 2018

On Wed, Sep 26, 2018 at 3:19 AM Marko Ristin-Kaufmann
<marko.ristin at gmail.com> wrote:
>> Claiming that DbC annotations will improve the documentation of every
>> single library on PyPI is an extraordinary claim, and such claims
>> require extraordinary proof.
> I don't know what you mean by "extraordinary" claim and "extraordinary" proof, respectively. I tried to show that DbC is a great tool and far superior to any other tools currently used to document contracts in a library, please see my message https://groups.google.com/d/msg/python-ideas/dmXz_7LH4GI/5A9jbpQ8CAAJ. Let me re-use the enumeration I used in the message and give you a short summary.

An ordinary claim is like "DbC can be used to improve code and/or
documentation", and requires about as much evidence as you can stuff
into a single email. Simple claim, low burden of proof.

An extraordinary claim is like "DbC can improve *every single project*
on PyPI". That requires a TON of proof. Obviously we won't quibble if
you can only demonstrate that 99.95% of them can be improved, but you
have to at least show that the bulk of them can.

> There are 150K projects on pypi.org. Each one of them would benefit if annotated with the contracts.

This is the extraordinary claim. To justify it, you have to show that
virtually ANY project would benefit from contracts. So far, I haven't
seen any such proof.


More information about the Python-ideas mailing list