if not valid:
    raise ParseException(string, loc, 'value not in range (%s,%s)' % (
        minval, maxval))
return rangeCheckParseAction
integer = Combine(Optional(oneOf('+ -')) + Word(nums))
integer.setParseAction(lambda t: int(t[0]))
month = integer.copy().addParseAction(rangeCheck(1, 12))
day = integer.copy().addParseAction(rangeCheck(1, 31))
year = integer.copy().addParseAction(rangeCheck(2000))
SLASH = Suppress('/')
dateExpr = year + SLASH + month + SLASH + day
print(dateExpr.parseString('2011/5/8'))
print(dateExpr.parseString('1999/12/31'))
Как передать значения для разбора pyparsing?