On Feb 24, 8:25 am, Neil Cerutti <ne...@norwich.edu> wrote: > > What Python needs is some constant that can be compared to ANY > > numeric type and that constant will ALWAYS be larger! > > What's the point of that? > > The only time I've naively pined for such a thing is when > misapplying C idioms for finding a minimum value.
The best use case is for default arguments to constructors or func/ meths. If you set the argument to INFINITY instead of -1 (or some other dumb string value to mean "unlimited") you can omit a useless conditional block later. Observe: if maxlength == -1 # unlimited length: keep_going() elif len(object) < maxlength: stop() # because we reached the limit I see tons and tons of old Python code that uses -1 as an "unlimited" value, where positive numbers are meant to constrain dome value. I have always found that to be intuitive; hence my question. -- http://mail.python.org/mailman/listinfo/python-list