Description
This module provides a collection of decorators that makes it easy to
write software using contracts.
Contracts are a debugging and verification tool. They are declarative
statements about what states a program must be in to be considered
"correct" at runtime. They are similar to assertions, and are verified
automatically at various well-defined points in the program. Contracts can
be specified on functions and on classes.
Contracts serve as a form of documentation and a way of formally
specifying program behavior. Good practice often includes writing all of
the contracts first, with these contract specifying the exact expected
state before and after each function or method call and the things that
should always be true for a given class of object.
Contracts consist of two parts: a description and a condition. The
description is simply a human-readable string that describes what the
contract is testing, while the condition is a single function that tests
that condition. The co
dpcontracts alternatives and similar packages
Based on the "Functional Programming" category.
Alternatively, view contracts alternatives based on common mentions on social networks and blogs.
-
Deal
🤝 Design by contract for Python. Write bug-free code. Add a few decorators, get static analysis and tests for free. -
PyContracts
PyContracts is a Python package that allows to declare constraints on function parameters and return values. Contracts can be specified using Python3 annotations, or inside a docstring. PyContracts supports a basic type system, variables binding, arithmetic constraints, and has several specialized contracts and an extension API.
Judoscale - Save 47% on cloud hosting with autoscaling that just works

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of dpcontracts or a related project?