This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Remove Thread.isAlive in Python 3.9
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: JelleZijlstra, asvetlov, corona10, vstinner
Priority: normal Keywords: patch

Created on 2019-08-09 15:34 by corona10, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15225 merged corona10, 2019-08-12 14:09
PR 25174 merged JelleZijlstra, 2021-04-04 01:08
Messages (8)
msg349293 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2019-08-09 15:34
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.
msg349455 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-08-12 11:23
Calling threading.isAlive() starts to emit a DeprecationWarning in Python 3.8. I'm ok to remove the alias in Python 3.9.
msg349481 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-08-12 17:41
New changeset 44046fe4fc7f00a6eb855b33e6a3f953cf5233a5 by Victor Stinner (Dong-hee Na) in branch 'master':
bpo-37804: Remove the deprecated method threading.Thread.isAlive() (GH-15225)
https://github.com/python/cpython/commit/44046fe4fc7f00a6eb855b33e6a3f953cf5233a5
msg390039 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2021-04-02 04:43
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.
msg390045 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-02 08:47
> 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
msg390056 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2021-04-02 12:42
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.
msg390059 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-02 13:07
> 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.
msg390827 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-12 08:43
New changeset 9825bdfbd5c966abf1f1b7264992d722a94c9613 by Jelle Zijlstra in branch 'master':
bpo-43723: Deprecate camelCase aliases from threading (GH-25174)
https://github.com/python/cpython/commit/9825bdfbd5c966abf1f1b7264992d722a94c9613
History
Date User Action Args
2022-04-11 14:59:18adminsetgithub: 81985
2021-04-12 08:43:01vstinnersetmessages: + msg390827
2021-04-04 01:08:40JelleZijlstrasetpull_requests: + pull_request23916
2021-04-02 13:07:00vstinnersetmessages: + msg390059
2021-04-02 12:42:29JelleZijlstrasetmessages: + msg390056
2021-04-02 08:47:34vstinnersetmessages: + msg390045
2021-04-02 04:43:22JelleZijlstrasetnosy: + JelleZijlstra
messages: + msg390039
2019-08-12 17:42:00vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-08-12 17:41:31vstinnersetmessages: + msg349481
2019-08-12 14:09:34corona10setkeywords: + patch
stage: patch review
pull_requests: + pull_request14949
2019-08-12 11:23:56vstinnersettitle: Remove Thread.isAlive in Python 3.8 -> Remove Thread.isAlive in Python 3.9
2019-08-12 11:23:54vstinnersettitle: Remove Thread.isAlive -> Remove Thread.isAlive in Python 3.8
2019-08-12 11:23:49vstinnersetmessages: + msg349455
2019-08-09 15:34:39corona10setcomponents: + Library (Lib)
title: Remove isAlive -> Remove Thread.isAlive
2019-08-09 15:34:12corona10create