Repository navigation
Remove Thread.isAlive in Python 3.9 #81985
Description
Activity
As we discussed https://bugs.python.org/issue35283.
Now is the time to remove Thread.isAlive.If it is okay, I 'd like to work on this issue.
- added3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Aug 9, 2019 Calling threading.isAlive() starts to emit a DeprecationWarning in Python 3.8. I'm ok to remove the alias in Python 3.9.
- changed the title
[-]Remove Thread.isAlive[/-][+]Remove Thread.isAlive in Python 3.8[/+]on Aug 12, 2019 - changed the title
[-]Remove Thread.isAlive in Python 3.8[/-][+]Remove Thread.isAlive in Python 3.9[/+]on Aug 12, 2019 The threading documentation for 3.9 still claims "While they are not listed below, the camelCase names used for some methods and functions in this module in the Python 2.x series are still supported by this module." It would be better to mention when isAlive was removed.
The method is still used in some major libraries, like NLTK (https://github.com/nltk/nltk/blob/637af5380d6071517a5f0d224649e5c3560b5f91/nltk/inference/api.py#L536). Documenting the removal clearly in the threading docs would make it easier for developers to upgrade.
The threading documentation for 3.9 still claims "While they are not listed below, the camelCase names used for some methods and functions in this module in the Python 2.x series are still supported by this module." It would be better to mention when isAlive was removed.
Do you want to propose a PR for that?
I see still 4 camelCase methods in threading.Thread:
- 'getName' => Thread.name can be get
- 'setName' => Thread.name can be set
- 'isDaemon' => Thread.name can be get
- 'setDaemon' => Thread.daemon can be set
Sure, I can submit a PR. While we're at it, we should probably also deprecate the setter/getter methods that you mention.
Here's what I propose doing:
- On 3.10 (or 3.11 if it's too late for 3.10), make getName and friends throw a DeprecationWarning, scheduling them for removal in 3.12 or 3.13
- On 3.8 and lower, update the docs to explicitly call out the names of the deprecated methods
- On 3.9 and higher, update the docs similarly but mention that threading.isAlive was already removed
If there's no objection, I'll open separate issues and PRs for these in a few days.
we should probably also deprecate the setter/getter methods that you mention
You can deprecate them. Please open a new issue for that, this one is closed and specific to Thread.isAlive.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: