design-by-contract
github.com · Open source · Quiet
Python decorator for design-by-contract checks using lambda conditions
- Developer tools
- Open source
- Python
- Day-7 check
- Day-30 check
- Stars
- 102
- Forks
- 7
- Open issues
- 0
- Last commit
- Releases
- 7
- Found
- 4 years ago
GitHub figures as of . They are context, not a ranking.
design-by-contract is a small Python package that adds contract checks through a decorator, with conditions written as lambda expressions alongside type hints. It suits Python 3.10 and later users who want contract checks in their code.
Repository description on GitHub: “Handy decorator for elegant design-by-contract in 3.10+”
What it does
- Contract checks added with a Python decorator
- Conditions written as lambda expressions
- Conditions sit alongside type annotations
Good for
- Check preconditions and return values in Python functions
- Write contract conditions alongside type hints
- Learn newer Python features through a small package
Suits: Python 3.10+ developers who want contract checks.
Worth knowing: Values can be shared between conditions only to a limited extent
What you can try
Read the README on GitHub and install from source.
Install
pip install design-by-contractConfirmed against the package registry. Read the project’s own instructions before running anything.
Links go to third-party sites KipFound does not control. KipFound has not installed, audited or tested this software.
Found vs. released
Kip first saw design-by-contract on , when stefanka posted it to Show HN. The oldest published release on GitHub is v0.1.0, dated . Its first tagged release came 5 days after it was found. 7 releases have been published in total; the latest is v0.3.1.1 ().
Day-7 and day-30 updates
Day 7 6 releases shipped
- 6 releases in the first 7 days: v0.1.0 (17 Jul 2022), v0.1.1 (17 Jul 2022), v0.2 (17 Jul 2022), v0.2.1 (17 Jul 2022), v0.2.2 (17 Jul 2022), v0.3.0 (17 Jul 2022)
- Show HN discussion at check time: 58 points, 12 comments. API record
Checked , later than day 7 because tracking began after.
Day 30 7 releases shipped
- 7 releases in the first 30 days: v0.1.0 (17 Jul 2022), v0.1.1 (17 Jul 2022), v0.2 (17 Jul 2022), v0.2.1 (17 Jul 2022), v0.2.2 (17 Jul 2022), v0.3.0 (17 Jul 2022), v0.3.1.1 (22 Jul 2022)
- Show HN discussion at check time: 58 points, 12 comments. API record
Checked , later than day 30 because tracking began after.
Release timeline every entry links to its source
- Repository created on GitHub: StefanUlbrich/design-by-contract
- Found: stefanka posted it to Show HN. Show HN
- Release v0.1.0
- Release v0.1.1
- Release v0.2
- Release v0.2.1
- Release v0.2.2
- Release v0.3.0
- Release v0.3.1.1
- Day-7 check recorded by Kip (details)
- Day-30 check recorded by Kip (details)
Quick answers
- When was design-by-contract released?
- Its first tagged release on GitHub is dated 17 Jul 2022. Kip found it on Show HN on 12 Jul 2022.
- Is design-by-contract open source?
- Its source is public on GitHub at StefanUlbrich/design-by-contract under the MIT licence.
- What does design-by-contract run on?
- Library.
- Is design-by-contract free?
- It is open source, so the code is free to read and run; check the licence for terms.
- Is design-by-contract still maintained?
- It has had no commit or release for over a year as of the latest check.
Provenance
| Source | Record | Last checked |
|---|---|---|
| Show HN | listing official API record | |
| GitHub repository | StefanUlbrich/design-by-contract REST API record | |
| GitHub Releases | release list REST API record |
Stable ID hn-32068447. Summary drafted with AI from the source records above and checked against KipFound’s rules before publishing. Dates and release facts come only from those records.
Share
Similar tools
Made this, or spotted a mistake? Ask for a correction or removal. No account or email address needed.