Skip to content

Remove Thread.isAlive in Python 3.9 #81985

Description

@corona10
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']

    Activity

    1. corona10 commented on Aug 9, 2019

      @corona10
      MemberAuthor

      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.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Aug 9, 2019
    3. changed the title [-]Remove isAlive[/-] [+]Remove Thread.isAlive[/+] on Aug 9, 2019
    4. vstinner commented on Aug 12, 2019

      @vstinner
      Member

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

    5. changed the title [-]Remove Thread.isAlive[/-] [+]Remove Thread.isAlive in Python 3.8[/+] on Aug 12, 2019
    6. changed the title [-]Remove Thread.isAlive in Python 3.8[/-] [+]Remove Thread.isAlive in Python 3.9[/+] on Aug 12, 2019
    7. vstinner commented on Aug 12, 2019

      @vstinner
      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

    8. JelleZijlstra commented on Apr 2, 2021

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

    9. vstinner commented on Apr 2, 2021

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

      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
    10. JelleZijlstra commented on Apr 2, 2021

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

    11. vstinner commented on Apr 2, 2021

      @vstinner
      Member

      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.

    12. vstinner commented on Apr 12, 2021

      @vstinner
      Member

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

    13. transferred this issue fromon Apr 10, 2022
    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

      3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directory

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions