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

Error to extend the library #69

Open Chuzz1996 opened 6 years ago

Chuzz1996 commented 6 years ago

Hello,

I trying to doing a contract that return a post-condition as:

@contract(x=object)
def method(x)->x.operation(5):
    return x.operation(5)

I don't know if I'm doing something wrong or if not supportable, in the second case i want to request your help to do it, in order to extend the library. Also i want to know if exist someway to construct an invariant into an object.

Thanks.