TBH, I think one of the main points of design by contract is that contracts are verified statically. For runtime contract checking I would rather recommend hypothesis library (or similar).
-- Ivan On Mon, 27 Aug 2018 at 08:05, Jacco van Dorp <j.van.d...@deonet.nl> wrote: > Total noob speaking here, but.... > > Those contracts are mostly important during development right ? Slowdown > isn't that much of an issue during development. So you could make a debug > mode that enforces the contracts, and a production mode that code users can > use during production to stop the slowdown - in this case, your decorators > can return their functions/classes unaltered. If they do end up with > problems, you can always ask them to run the same inputs with debug mode on > to see where it goes wrong. > > For the rest, i'm totally new to design by contract. I do get the draw of > it, but im not sure if I'd ever really use it. I tend to solve my problems > with a royal sprinkling of logger.debug(f"{val_i_need_to_check}"). > _______________________________________________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/