Design by Contract in Python: proposal for native class invariants

But I don’t think you are doing yourself any favors by framing this as a suggestion to add it to python at this point in time. By doing that you are encouraging everyone (including myself) to provide counter arguments why not to do this and leading to an antagonistic relationship (as can be clearly seen from this thread).

If you instead frame it as a library/framework that solves some real world issues right now you will get more positive responses (even if it’s maybe fewer of them) and I think that increases your chance of this being adopted and maybe added to python (on a timeframe of 5 years at the low end ofcourse).

3 Likes

Totally fair. The original post wasn’t meant to bypass the slow path; it was just meant to get the conversation started and surface early thoughts. So thank you for your contribution.

For those curious about the broader motivation behind this or how it fits into a bigger effort, I’ve launched https://beyondtesting.dev to explore correctness, DbC, and developer trust from different angles. Still early, but growing.

1 Like