Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unncessary enum._power_of_two function #101341

Closed
corona10 opened this issue Jan 26, 2023 · 2 comments
Closed

Remove unncessary enum._power_of_two function #101341

corona10 opened this issue Jan 26, 2023 · 2 comments
Labels
type-feature A feature request or enhancement

Comments

@corona10
Copy link
Member

corona10 commented Jan 26, 2023

cpython/Lib/enum.py

Lines 1568 to 1571 in dfad678

def _power_of_two(value):
if value < 1:
return False
return value == 2 ** _high_bit(value)

This function looks like be defined by mistake.

Linked PRs

@arhadthedev
Copy link
Member

This method is introduced in 7aaeb2a. According to the parent issue (gh-82431) it was supposed to be somehow used in iterators created by enum.__iter__().

@ethanfurman (an author of that commit) Can we remove iterator._power_of_two() or you'll develop it further?

@ethanfurman
Copy link
Member

It can go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants