W
Wolfgang Meiners
Am 24.02.12 14:37, schrieb Rick Johnson:
# get_limit() returns None if there is no limit
maxlength = get_limit()
if maxlength and (len(string) <= maxlength):
allow_passage()
else:
deny_passage()
Wolfgang
If there is no limit for len(string), why not simply useI get sick and tired of doing this!!!
if maxlength == UNLIMITED:
allow_passage()
elif len(string) > maxlength:
deny_passage()
What Python needs is some constant that can be compared to ANY numeric
type and that constant will ALWAYS be larger!
# get_limit() returns None if there is no limit
maxlength = get_limit()
if maxlength and (len(string) <= maxlength):
allow_passage()
else:
deny_passage()
Wolfgang