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.
I would've expected it to fail since the two lists have different lengths, but it doesn't throw an error. However, if I don't use new_contract, it works. Is this the intended behaviour? If so, how would I get the behaviour that I want? I'm using version 1.7.15.
With the following code:
I would've expected it to fail since the two lists have different lengths, but it doesn't throw an error. However, if I don't use
new_contract
, it works. Is this the intended behaviour? If so, how would I get the behaviour that I want? I'm using version 1.7.15.