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

`number` does not respect `long` #47

Open averagehat opened 8 years ago

averagehat commented 8 years ago
In [32]: @contract(a='number')
    ...: def foo(a):
    ...:     return a
In [33]: foo(9999999L)
 . . . .  . . .  . 
.................. # long error outptut here
 ------- (end clauses) -------
checking: float|int|uint      for value: Instance of <type 'long'>: 9999999L   
checking: $(float|int|uint)   for value: Instance of <type 'long'>: 9999999L   
checking: number              for value: Instance of <type 'long'>: 9999999L   
Variables bound in inner context: