contracts
CyToolz
contracts | CyToolz | |
---|---|---|
1 | 2 | |
397 | 971 | |
- | 0.3% | |
0.0 | 6.0 | |
8 days ago | 19 days ago | |
Python | Python | |
GNU General Public License v3.0 or later | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
contracts
-
Show HN: A design-by-contract Python package in ~100 lines
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)
CyToolz
-
oop vs fp...
Unless you are willing to install third-party libraries, particularly advanced design patterns in Python are best represented by verbose classes. In the hands of an experienced Python coder, simpler scripts tend to be almost fully functional (disregarding enums and dataclasses), save for situations like GUI design where your subroutines constantly take in and outputs over a shared state.
-
Toolz - A functional standard library for Python
And don't miss that there's a high-performance Cython reimplementation of it, too: https://github.com/pytoolz/cytoolz/
What are some alternatives?
icontract - Design-by-contract in Python3 with informative violation messages and inheritance
Toolz - A functional standard library for Python.
classes - Smart, pythonic, ad-hoc, typed polymorphism for Python
funcy - A fancy and practical functional tools
Deal - 🤝 Design by contract for Python. Write bug-free code. Add a few decorators, get static analysis and tests for free.
returns - Make your functions return something meaningful, typed, and safe!
Pyrsistent - Persistent/Immutable/Functional data structures for Python
Coconut - Simple, elegant, Pythonic functional programming.
fn.py - Functional programming in Python: implementation of missing features to enjoy FP
effect - effect isolation in Python, to facilitate more purely functional code