from __future__ import print_function


@check.arg(0, check.int_value(min=0))
@check.arg(1, check.int_value(min=0))
def add_positive_integers(int1, int2):
    return int1 + int2


def main():
    print(add_positive_integers(1, 5))
    print(add_positive_integers(0, 5))
    print(add_positive_integers(-1, 5))


if __name__ == '__main__':
    main()

@@ -35,30 +35,1099 @@
 ion%0A
-%0A%0A@check.arg(0, check.
+from collections import defaultdict%0A%0A%0Adef check_arg(arg_id, *constraints):%0A    return ArgCheckAdder(arg_id, *constraints)%0A%0A%0Adef check_int_value(min=None, max=None):%0A    def constraint(arg_id, args, kwargs):%0A        assert isinstance(args%5Barg_id%5D, int)%0A        assert args%5Barg_id%5D %3E= 0%0A    return constraint%0A%0A%0Aclass ArgCheckAdder(object):%0A    def __init__(self, arg_id, *constraints):%0A        self.arg_id = arg_id%0A        self.constraints = constraints%0A%0A    def __call__(self, func):%0A        if hasattr(func, 'checks'):%0A            func.checks%5Bself.arg_id%5D.extend(self.constraints)%0A            return func%0A        else:%0A            return CheckedFunction(func, %7Bself.arg_id: self.constraints%7D)%0A%0A%0Aclass CheckedFunction(object):%0A    def __init__(self, func, checks):%0A        self.checks = defaultdict(list)%0A        self.checks.update(checks)%0A        self.func = func%0A%0A    def __call__(self, *args, **kwargs):%0A        for arg_id, checks in self.checks.items():%0A            for check in checks:%0A                check(arg_id, args, kwargs)%0A        self.func(*args, **kwargs)%0A%0A%0A@check_arg(0, check_
 int_
@@ -1146,17 +1146,17 @@
 )%0A@check
-.
+_
 arg(1, c
@@ -1159,17 +1159,17 @@
 1, check
-.
+_
 int_valu

Make isolated arg check example