AndreaCensi / 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.
http://andreacensi.github.io/contracts/
Other
398 stars 62 forks source link

Add exponents #55

Closed StefanUlbrich closed 6 years ago

StefanUlbrich commented 7 years ago

Hi,

Thank you for your lovely project. However, I was missing the ability to check for array dimensions that are of the form N=3**M (necessary for machine learning in high dimensional spaces). I added another literal "^" which seems to work.

Best Stefan

PS: This is my first pull request on GitHub