On Feb 24, 7:55 am, Mark Lawrence <[email protected]> wrote:
> Do you want to test for something that is larger than infinity?
Not exactly. I want to set a constant that has a value of infinity and
then do comparisons against the constant.
##################
# Hypothetical 1 #
##################
def confine(string, maxlength=INFINITY):
return string[:maxlength]
py> confine('123')
'123'
py> confine('123', 1)
'1'
##################
# Hypothetical 2 #
##################
def confine(string, maxlength=INFINITY):
if len(string) < maxlength:
do_something()
else:
twiddle_thumbs()
--
http://mail.python.org/mailman/listinfo/python-list