Open Yay295 opened 1 month ago
Another optimization could be done here: https://github.com/python/cpython/blob/9ce90206b7a4649600218cf0bd4826db79c9a312/Lib/colorsys.py#L142
n % 1
is the same as n - floor(n)
. However, this technically changes the function argument requirements from needing the __mod__
or __rmod__
methods to needing the __floor__
method.
Please look at the rejected issue #114577 and PR #114578 to see if any of the comments are relevant here.
They are not. That PR did not functionally change colorsys.rgb_to_hsv
, but it did replace some if
s with function calls elsewhere, which my change does not do.
Please look at the rejected issue #114577 and PR #114578 to see if any of the comments are relevant here.
I remember that😂 My first PR and rejected
Feature or enhancement
Proposal:
By inlining some variables, the number of operations performed can be reduced. Example: with
then
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs