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 Thread.isAlive in Python 3.9 #81985

Closed
corona10 opened this issue Aug 9, 2019 · 8 comments
Closed

Remove Thread.isAlive in Python 3.9 #81985

corona10 opened this issue Aug 9, 2019 · 8 comments
Labels
3.9 only security fixes stdlib Python modules in the Lib dir

Comments

@corona10
Copy link
Member

corona10 commented Aug 9, 2019

BPO 37804
Nosy @vstinner, @asvetlov, @JelleZijlstra, @corona10
PRs
  • bpo-37804: Remove the deprecated method threading.Thread.isAlive() #15225
  • bpo-43723: deprecate camelCase aliases from threading #25174
  • 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:

    assignee = None
    closed_at = <Date 2019-08-12.17:42:00.760>
    created_at = <Date 2019-08-09.15:34:12.371>
    labels = ['library', '3.9']
    title = 'Remove Thread.isAlive in Python 3.9'
    updated_at = <Date 2021-04-12.08:43:01.529>
    user = 'https://github.com/corona10'

    bugs.python.org fields:

    activity = <Date 2021-04-12.08:43:01.529>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-08-12.17:42:00.760>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2019-08-09.15:34:12.371>
    creator = 'corona10'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37804
    keywords = ['patch']
    message_count = 8.0
    messages = ['349293', '349455', '349481', '390039', '390045', '390056', '390059', '390827']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'asvetlov', 'JelleZijlstra', 'corona10']
    pr_nums = ['15225', '25174']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37804'
    versions = ['Python 3.9']

    @corona10
    Copy link
    Member Author

    corona10 commented Aug 9, 2019

    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.

    @corona10 corona10 added 3.9 only security fixes stdlib Python modules in the Lib dir labels Aug 9, 2019
    @corona10 corona10 changed the title Remove isAlive Remove Thread.isAlive Aug 9, 2019
    @vstinner
    Copy link
    Member

    Calling threading.isAlive() starts to emit a DeprecationWarning in Python 3.8. I'm ok to remove the alias in Python 3.9.

    @vstinner vstinner changed the title Remove Thread.isAlive Remove Thread.isAlive in Python 3.8 Aug 12, 2019
    @vstinner vstinner changed the title Remove Thread.isAlive in Python 3.8 Remove Thread.isAlive in Python 3.9 Aug 12, 2019
    @vstinner
    Copy link
    Member

    New changeset 44046fe by Victor Stinner (Dong-hee Na) in branch 'master':
    bpo-37804: Remove the deprecated method threading.Thread.isAlive() (GH-15225)
    44046fe

    @JelleZijlstra
    Copy link
    Member

    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.

    @vstinner
    Copy link
    Member

    vstinner commented Apr 2, 2021

    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

    @JelleZijlstra
    Copy link
    Member

    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.

    @vstinner
    Copy link
    Member

    vstinner commented Apr 2, 2021

    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.

    @vstinner
    Copy link
    Member

    New changeset 9825bdf by Jelle Zijlstra in branch 'master':
    bpo-43723: Deprecate camelCase aliases from threading (GH-25174)
    9825bdf

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants