pygame
pygame copied to clipboard
Make pygame.math.clamp only take numbers
This removes the support for different types, but makes the function clearer for beginners, and gives more comprehensible errors. This also will make implementing other math functions nicer, since we won't have to worry about inconsistencies with some math functions taking any object that defines certain methods, and others taking only numbers.
The reason I'm not simply using PyFloat_AsDouble is because converting to C types is slower than dealing with python objects directly.