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 defined this custom contract:
And used it on an object's methods self argument like so:
But when there is this error message when the 'valid_communities' contract is violated:
Any idea why this might be the case?