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
399 stars 61 forks source link

Try to import numpy only once #24

Closed yuvallanger closed 9 years ago

yuvallanger commented 9 years ago

Would love to get criticism of this code. Also, how do I test it?

AndreaCensi commented 9 years ago

You can test it using "nosetests".

It looks like you are trying to do what's called "memoization".

yuvallanger commented 9 years ago

numpy.number won't ever be referred without successfully importing numpy, but it still fails the test. Any ideas?