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.
Toolz7.6 5.7 L4 dpcontracts VS ToolzA functional standard library for Python.
fn.py7.1 0.0 L4 dpcontracts VS fn.pyFunctional programming in Python: implementation of missing features to enjoy FP
Coconut7.1 0.0 dpcontracts VS CoconutSimple, elegant, Pythonic functional programming.
funcy6.8 5.0 L5 dpcontracts VS funcyA fancy and practical functional tools
returns6.4 8.7 dpcontracts VS returnsMake your functions return something meaningful, typed, and safe!
Pyrsistent5.8 4.8 L5 dpcontracts VS PyrsistentPersistent/Immutable/Functional data structures for Python
CyToolz4.4 7.4 L4 dpcontracts VS CyToolzCython implementation of Toolz: High performance functional utilities
classes3.5 7.4 dpcontracts VS classesSmart, pythonic, ad-hoc, typed polymorphism for Python
Deal3.4 8.1 dpcontracts VS DealDesign by contract for Python. Write bug-free code. Add a few decorators, get static analysis and tests for free.
PyContracts3.3 0.0 dpcontracts VS PyContractsPyContracts 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.
effect2.9 3.4 dpcontracts VS effecteffect isolation in Python, to facilitate more purely functional code
icontract2.7 4.9 dpcontracts VS icontractDesign-by-contract in Python3 with informative violation messages and inheritance
Access the most powerful time series database as a service
* 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?