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.
Hi,
first of all, thanks for your awesome library!
Second, I added your library in a project of mine where I include unicode_literals (from future ) in all the modules, that is causing me some issues with your library because the contract decorator expects a lot of things but not a unicode object.
I was wondering if you could check on contracts/main.py:337 if the spec is an instance of basestring instead of str so that unicode will also match.
I fixed the checks that I could find so this might be partially fixed. The changes are in master and with the latest release 1.7.4. Let me know if I forgot some other check.
Hi, first of all, thanks for your awesome library! Second, I added your library in a project of mine where I include unicode_literals (from future ) in all the modules, that is causing me some issues with your library because the contract decorator expects a lot of things but not a unicode object.
I was wondering if you could check on contracts/main.py:337 if the spec is an instance of basestring instead of str so that unicode will also match.
Thanks!