-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
"threading._DummyThread" redefines "is_alive" but forgets "isAlive" #79464
Comments
In module "threading", class "Thread" defines "is_alive" and defines "isAlive = is_alive". The derived class "_DummyThread" redefines "is_alive" but forgets to update the "isAlive" alias. As a consequence, calling "_DummyThread.isAlive" leads to an "AssertionErrror". The "isAlive" method is mentioned in the docstring of "Thread.join". |
Care to open a PR to fix this? |
I am not familiar with the "github" workflow. The fix is so trivial (add the "isAlive = is_alive" alias to "threading._DummyThread" and replace "isAlive" by "is_alive" in the docstring of "threading.Thread.join" that it does not seem worth to learn the "github" workflow just for this fix. |
Hi, Can I work with this issue if no one works on it? |
isAlive() is the part of the old API. It is not even documented in Python 3, and can be removed in future. It is better to remove it from docstrings. |
And since threads support no longer optional, are there reasons to keep _DummyThread? |
If it's not already deprecated, I'd say deprecate it first. |
The only _DummyThread usage is
|
I guess the question is whether any other Python implementation is threadless? E.g. is MicroPython? If it even has threads then I agree about deprecating the module. But if MicroPython does support threads we should keep the module. That would mean updating all references of isAlive() to is_alive() and adding the name alias since that name aliasing still exists in 'master' right now (probably for Python 2 porting support): Line 1094 in 3bb183d
@dmaurer totally understand about time restraints, but do realize even "trivial" fixes like this would still take at least an hour to do a proper job so there's no guarantee someone will get around to fixing this. But if you do change your mind and want to give it a try, then https://devguide.python.org/ is there to help. |
emscripten python ( cpython on asm.js or webassembly ) is threadless |
about micropython, only unix port have thread basic implementation and garbage collector messes with EINTR actually so it is not very useable. unix port is only one on many, and is the less interesting port apart from running quick simulations. |
Well, to satisfy everybody we need to:
Did I miss something? |
I agree with asvetlov :) |
I think the only thing missing from your list, Andrew, is updating docstrings and such to mention is_alive() instead of isAlive(). |
Hi, I am going to solve this issue through below process.
Is it okay? |
For me, this would be perfect. |
I suggest to start with:
We may apply such changes to Python 3.7, maybe also emit a PendingDeprecationWarning. |
Ok, master now emits a deprecation warning. Is it worth it to emit a pending deprecation warning in Python 3.7? |
I think yes. |
Great! |
Not sure. IMHO it is not a *notable* change worth to be mentioned in https://docs.python.org/3/whatsnew/3.7.html#notable-changes-in-python-3-7-2 |
I've upload PR 11604 |
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:
The text was updated successfully, but these errors were encountered: