Feature or enhancement
Proposal:
The keep_top_bit() function in the heapq module currently shifts bits manually to determine the top bit. This can be optimized by using the _Py_bit_length() function, which improves efficiency, especially on hardware that supports specific instructions like bsr on x86 architecture.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs