def limit(value, min=negative_infinite, max=positive_infinite): """Limit a numeric value to the specified range""" return maximum(min, minimum(value, max))