Skip to content

Unused code in concurrent.future #120157

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

Closed
aisk opened this issue Jun 6, 2024 · 1 comment
Closed

Unused code in concurrent.future #120157

aisk opened this issue Jun 6, 2024 · 1 comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@aisk
Copy link
Contributor

aisk commented Jun 6, 2024

Bug report

Bug description:

https://github.com/python/cpython/blob/fd104dfcb838d735ef8128e3539d7a730d403422/Lib/concurrent/futures/_base.py#L26C1-L32

The _FUTURE_STATES variable hasn't been used in this file, and nor in other files: https://github.com/search?q=repo%3Apython%2Fcpython%20_FUTURE_STATES&type=code

And since it has an underscore prefix in the name, it's a private variable and won't be used by users.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

@aisk aisk added type-bug An unexpected behavior, bug, or error stdlib Python modules in the Lib dir labels Jun 6, 2024
pygeek added a commit to pygeek/cpython that referenced this issue Jun 7, 2024
pygeek added a commit to pygeek/cpython that referenced this issue Jun 7, 2024
pygeek added a commit to pygeek/cpython that referenced this issue Jun 7, 2024
pygeek added a commit to pygeek/cpython that referenced this issue Jun 7, 2024
@gaogaotiantian
Copy link
Member

I would proceed with some extra caution there. It seems like even when it was first checked in, that variable is not referenced anywhere. So it's not like the usage was removed some time after the initial checked in and the variable was left there. It's possible that this was accidentally merged to begin with, but the code has been there for 14 years.

I'm not saying that we should not remove those, but I'll feel a bit more confident if we can figure out why it was there in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants