Skip to content

class Thread has an isAlive on Python 3. #2552

Closed
@timabbott

Description

@timabbott

stdlib/2and3/threading.pyi defines class Thread like this:


```class Thread:                                                                                                             
   ...
    def is_alive(self) -> bool: ...                                                                                       
    if sys.version_info < (3,):                                                                                           
        def isAlive(self) -> bool: ...                                                                                    

It appears that isAlive still exists at least in Python 3.5, though it isn't documented:

tabbott@zaset:~/zulip$ ipython3
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
Type "copyright", "credits" or "license" for more information.

IPython 2.4.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from threading import *

In [2]: x = Thread()

In [3]: x.isAlive()
Out[3]: False

Not submitting a PR since I haven't had a chance to investigate whether other Python 3.x versions are different.

Metadata

Metadata

Assignees

No one assigned

    Labels

    stubs: incompleteAnnotations or sub-modules missing from an existing package or module

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions