return 'at most %s' % commafy(self.max)
else:
return 'at most %g' % self.max
- elif self.min_length is not None and self.max_length is not None:
+ elif self.min_length != 0 and self.max_length != sys.maxint:
if self.min_length == self.max_length:
return 'exactly %d characters long' % (self.min_length)
else:
return 'between %d and %d characters long' % (self.min_length, self.max_length)
- elif self.min_length is not None:
+ elif self.min_length != 0:
return 'at least %d characters long' % self.min_length
- elif self.max_length is not None:
+ elif self.max_length != sys.maxint:
return 'at most %d characters long' % self.max_length
else:
return ''
elif self.type == StringType:
if self.min_length is not None:
stmts.append('%s.u.string.minLen = %d;' % (var, self.min_length))
- if self.max_length is not None:
+ if self.max_length != sys.maxint:
stmts.append('%s.u.string.maxLen = %d;' % (var, self.max_length))
elif self.type == UuidType:
if self.ref_table is not None: