pygame icon indicating copy to clipboard operation
pygame copied to clipboard

Make pygame.math.clamp only take numbers

Open JamesC01 opened this issue 3 years ago • 0 comments

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.

JamesC01 avatar Jul 31 '22 20:07 JamesC01