Skip to content

Unused code in concurrent.future #120157

Closed
Closed

Description

@aisk

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

Activity

  1. added
    type-bug
    stdlib
    on Jun 6, 2024
  2. added 4 commits that reference this issue on Jun 7, 2024
  3. gaogaotiantian commented on Jun 7, 2024

    @gaogaotiantian
    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.

  4. added a commit that references this issue on Jun 7, 2024
  5. added a commit that references this issue on Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions