URL |
Status |
Linked |
Edit |
PR 11454 |
merged |
corona10,
2019-01-07 08:18
|
|
PR 11454 |
merged |
corona10,
2019-01-07 08:18
|
|
PR 11454 |
merged |
corona10,
2019-01-07 08:18
|
|
PR 11459 |
closed |
corona10,
2019-01-07 15:26
|
|
PR 11459 |
closed |
corona10,
2019-01-07 15:26
|
|
PR 11459 |
closed |
corona10,
2019-01-07 15:26
|
|
PR 11596 |
merged |
corona10,
2019-01-17 23:24
|
|
PR 11596 |
merged |
corona10,
2019-01-17 23:24
|
|
PR 11596 |
merged |
corona10,
2019-01-17 23:24
|
|
PR 11604 |
merged |
corona10,
2019-01-18 09:07
|
|
PR 11604 |
merged |
corona10,
2019-01-18 09:07
|
|
PR 11604 |
merged |
corona10,
2019-01-18 09:07
|
|
msg330158 - (view) |
Author: Dieter Maurer (dmaurer) |
Date: 2018-11-20 22:16 |
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".
|
msg330216 - (view) |
Author: Brett Cannon (brett.cannon) * |
Date: 2018-11-21 21:05 |
Care to open a PR to fix this?
|
msg330219 - (view) |
Author: Dieter Maurer (dmaurer) |
Date: 2018-11-21 21:31 |
> 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.
|
msg330237 - (view) |
Author: Dong-hee Na (corona10) * |
Date: 2018-11-22 09:14 |
Hi, Can I work with this issue if no one works on it?
|
msg330242 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2018-11-22 11:25 |
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.
|
msg330244 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2018-11-22 11:27 |
And since threads support no longer optional, are there reasons to keep _DummyThread?
|
msg330245 - (view) |
Author: Antoine Pitrou (pitrou) * |
Date: 2018-11-22 11:28 |
If it's not already deprecated, I'd say deprecate it first.
|
msg330247 - (view) |
Author: Dong-hee Na (corona10) * |
Date: 2018-11-22 11:43 |
@serhiy.storchaka @pitrou
Then should we add the deprecated message
for isAlive of class "Thread" first?
|
msg330248 - (view) |
Author: Andrew Svetlov (asvetlov) * |
Date: 2018-11-22 12:02 |
The only _DummyThread usage is `threading.current_thread()`:
> If the caller's thread of control was not created through the threading
> module, a dummy thread object with limited functionality is returned.
|
msg330277 - (view) |
Author: Brett Cannon (brett.cannon) * |
Date: 2018-11-22 19:26 |
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): https://github.com/python/cpython/blob/3bb183d7fb83ad6a84ec13dea90f95d67be35c69/Lib/threading.py#L1094
@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.
|
msg330278 - (view) |
Author: pmp-p (pmpp) * |
Date: 2018-11-22 19:34 |
> I guess the question is whether any other Python implementation is threadless?
emscripten python ( cpython on asm.js or webassembly ) is threadless
|
msg330279 - (view) |
Author: pmp-p (pmpp) * |
Date: 2018-11-22 19:37 |
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.
|
msg330280 - (view) |
Author: Andrew Svetlov (asvetlov) * |
Date: 2018-11-22 20:11 |
Well, to satisfy everybody we need to:
1. Implement `isAlive` for dummy thread
2. Add a deprecation warning for both Thread.isAlive and _DummyThread.isAlive
3. Remove isAlive in future Python release (3.8 for the deprecation, 3.8+2 for removal).
4. Backporting the property down to 3.7 and 3.6 doesn't hurt, let's do it
Did I miss something?
|
msg330293 - (view) |
Author: Dong-hee Na (corona10) * |
Date: 2018-11-23 02:55 |
@asvetlov
I agree with asvetlov :)
|
msg330472 - (view) |
Author: Brett Cannon (brett.cannon) * |
Date: 2018-11-26 22:00 |
I think the only thing missing from your list, Andrew, is updating docstrings and such to mention is_alive() instead of isAlive().
|
msg330917 - (view) |
Author: Dong-hee Na (corona10) * |
Date: 2018-12-03 09:00 |
Hi, I am going to solve this issue through below process.
1. Implement `isAlive` for dummy thread
2. Updating docstrings to recommend use is_alive() instead of isAlive().
3. Add a deprecation warning for both Thread.isAlive and _DummyThread.isAlive
4. Remove isAlive in future Python release (3.8 for the deprecation, 3.8+2 for removal).
5. Backporting the property down to 3.7 and 3.6 doesn't hurt, let's do it
Is it okay?
|
msg330922 - (view) |
Author: Dieter Maurer (dmaurer) |
Date: 2018-12-03 09:35 |
> Hi, I am going to solve this issue through below process.
> ...
> Is it okay?
For me, this would be perfect.
|
msg333156 - (view) |
Author: STINNER Victor (vstinner) * |
Date: 2019-01-07 14:43 |
I suggest to start with:
* Updating docstrings to recommend use is_alive() instead of isAlive(), and add a deprecation warning for Thread.isAlive
We may apply such changes to Python 3.7, maybe also emit a PendingDeprecationWarning.
|
msg333170 - (view) |
Author: Dong-hee Na (corona10) * |
Date: 2019-01-07 15:28 |
@vstinner
Thanks, I've submitted PR 11459 for 3.7 which emit PendingDeprecationWarning.
|
msg333854 - (view) |
Author: STINNER Victor (vstinner) * |
Date: 2019-01-17 12:14 |
New changeset 89669ffe10a9db6343f6ee42239e412c8ad96bde by Victor Stinner (Dong-hee Na) in branch 'master':
bpo-35283: Add deprecation warning for Thread.isAlive (GH-11454)
https://github.com/python/cpython/commit/89669ffe10a9db6343f6ee42239e412c8ad96bde
|
msg333856 - (view) |
Author: STINNER Victor (vstinner) * |
Date: 2019-01-17 12:18 |
Ok, master now emits a deprecation warning. Is it worth it to emit a pending deprecation warning in Python 3.7?
|
msg333911 - (view) |
Author: Andrew Svetlov (asvetlov) * |
Date: 2019-01-17 23:43 |
I think yes.
People will be notified about depreciation earlier, even after 3.8 release not everybody switches to a new version fast.
For example, I still use 3.6 for my job now (but we are planning to switch to 3.7 in a month or two).
Adding PendingDeprecationWarning to 3.7 is safe, I expect a very few code uses `.isAlive()` on Python 3.
|
msg333930 - (view) |
Author: Dong-hee Na (corona10) * |
Date: 2019-01-18 02:07 |
Great!
Should we notify this deprecation also on Doc/whatsnew/3.7.rst?
|
msg333951 - (view) |
Author: Andrew Svetlov (asvetlov) * |
Date: 2019-01-18 08:25 |
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
|
msg333954 - (view) |
Author: Dong-hee Na (corona10) * |
Date: 2019-01-18 09:08 |
I've upload PR 11604
Thanks always
|
msg333955 - (view) |
Author: STINNER Victor (vstinner) * |
Date: 2019-01-18 09:50 |
New changeset 36d9e9a4d5238d5a2f09679b6c51be66fbfc12c4 by Victor Stinner (Dong-hee Na) in branch 'master':
bpo-35283: Update the docstring of threading.Thread.join method (GH-11596)
https://github.com/python/cpython/commit/36d9e9a4d5238d5a2f09679b6c51be66fbfc12c4
|
msg333966 - (view) |
Author: STINNER Victor (vstinner) * |
Date: 2019-01-18 14:09 |
New changeset c2647f2e45d2741fc44fd621966e05d15f2cd26a by Victor Stinner (Dong-hee Na) in branch '3.7':
bpo-35283: Add pending deprecation warning for Thread.isAlive (GH-11604)
https://github.com/python/cpython/commit/c2647f2e45d2741fc44fd621966e05d15f2cd26a
|
|
Date |
User |
Action |
Args |
2022-04-11 14:59:08 | admin | set | github: 79464 |
2019-01-18 14:17:47 | asvetlov | set | status: open -> closed stage: patch review -> resolved resolution: fixed versions:
+ Python 3.7, Python 3.8 |
2019-01-18 14:09:48 | vstinner | set | messages:
+ msg333966 |
2019-01-18 09:50:51 | vstinner | set | messages:
+ msg333955 |
2019-01-18 09:08:50 | corona10 | set | messages:
+ msg333954 |
2019-01-18 09:07:51 | corona10 | set | pull_requests:
+ pull_request11328 |
2019-01-18 09:07:37 | corona10 | set | pull_requests:
+ pull_request11327 |
2019-01-18 09:07:22 | corona10 | set | pull_requests:
+ pull_request11326 |
2019-01-18 08:25:00 | asvetlov | set | messages:
+ msg333951 |
2019-01-18 08:17:24 | pitrou | set | nosy:
- pitrou
|
2019-01-18 02:07:28 | corona10 | set | messages:
+ msg333930 |
2019-01-17 23:43:33 | asvetlov | set | messages:
+ msg333911 |
2019-01-17 23:25:00 | corona10 | set | pull_requests:
+ pull_request11303 |
2019-01-17 23:24:48 | corona10 | set | pull_requests:
+ pull_request11302 |
2019-01-17 23:24:33 | corona10 | set | pull_requests:
+ pull_request11301 |
2019-01-17 12:18:49 | vstinner | set | messages:
+ msg333856 |
2019-01-17 12:14:50 | vstinner | set | messages:
+ msg333854 |
2019-01-07 15:28:14 | corona10 | set | messages:
+ msg333170 |
2019-01-07 15:26:24 | corona10 | set | pull_requests:
+ pull_request10933 |
2019-01-07 15:26:12 | corona10 | set | pull_requests:
+ pull_request10932 |
2019-01-07 15:26:01 | corona10 | set | pull_requests:
+ pull_request10931 |
2019-01-07 14:43:44 | vstinner | set | nosy:
+ vstinner messages:
+ msg333156
|
2019-01-07 08:19:27 | corona10 | set | pull_requests:
+ pull_request10923 |
2019-01-07 08:19:12 | corona10 | set | pull_requests:
+ pull_request10922 |
2019-01-07 08:18:56 | corona10 | set | pull_requests:
+ pull_request10921 |
2018-12-03 09:35:58 | dmaurer | set | messages:
+ msg330922 |
2018-12-03 09:00:25 | corona10 | set | messages:
+ msg330917 |
2018-11-26 22:00:26 | brett.cannon | set | messages:
+ msg330472 |
2018-11-23 02:55:58 | corona10 | set | messages:
+ msg330293 |
2018-11-22 20:11:08 | asvetlov | set | messages:
+ msg330280 |
2018-11-22 19:37:00 | pmpp | set | messages:
+ msg330279 |
2018-11-22 19:34:42 | pmpp | set | nosy:
+ pmpp messages:
+ msg330278
|
2018-11-22 19:26:33 | brett.cannon | set | messages:
+ msg330277 |
2018-11-22 12:02:34 | asvetlov | set | nosy:
+ asvetlov messages:
+ msg330248
|
2018-11-22 11:43:34 | corona10 | set | messages:
+ msg330247 |
2018-11-22 11:41:47 | corona10 | set | pull_requests:
- pull_request9906 |
2018-11-22 11:28:20 | pitrou | set | messages:
+ msg330245 |
2018-11-22 11:27:44 | serhiy.storchaka | set | nosy:
+ pitrou messages:
+ msg330244
|
2018-11-22 11:25:16 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages:
+ msg330242
|
2018-11-22 11:16:07 | corona10 | set | keywords:
+ patch stage: patch review pull_requests:
+ pull_request9906 |
2018-11-22 09:14:11 | corona10 | set | nosy:
+ corona10 messages:
+ msg330237
|
2018-11-21 21:31:32 | dmaurer | set | messages:
+ msg330219 |
2018-11-21 21:05:16 | brett.cannon | set | type: crash -> behavior |
2018-11-21 21:05:00 | brett.cannon | set | nosy:
+ brett.cannon messages:
+ msg330216
|
2018-11-20 22:16:29 | dmaurer | create | |