def integervalidator(text): if text in ('', '-', '+'): return PARTIAL try: string.atol(text) return OK except ValueError: return ERROR