contracts

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. (by AndreaCensi)

Contracts Alternatives

Similar projects and alternatives to contracts

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better contracts alternative or higher similarity.

contracts reviews and mentions

Posts with mentions or reviews of contracts. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-07-12.
  • Show HN: A design-by-contract Python package in ~100 lines
    2 projects | news.ycombinator.com | 12 Jul 2022
    Seems you refer to a domain specific language in the annotations. This is exactly what https://github.com/AndreaCensi/contracts does (it's an amazing project but has a very large code base). However, I wanted to achieve something similar in pure python and as compact as possible – so there are compromises (like no real symbolic calculus)

Stats

Basic contracts repo stats
1
397
0.0
8 days ago

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com