Is there a built-in function for this in Python 2.6?
Something like:
clamp(myValue, min, max)
There's no such function, but
max(min(my_value, max_value), min_value)
will do the trick.