[issue34476] asyncio.sleep(0) not documented

2018-10-01 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: +Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34476] asyncio.sleep(0) not documented

2018-10-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: thanks! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue34476] asyncio.sleep(0) not documented

2018-10-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 655608a1112e592cd6a9155ebe774dd285f561f3 by Andrew Svetlov (Miss Islington (bot)) in branch '3.7': bpo-34476: Document that asyncio.sleep() always suspends. (GH-9643) (#9654)

[issue34476] asyncio.sleep(0) not documented

2018-10-01 Thread miss-islington
Change by miss-islington : -- pull_requests: +9045 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34476] asyncio.sleep(0) not documented

2018-10-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset cd602b8af2d14ff686261eeb18b80f718bb16550 by Andrew Svetlov (Hrvoje Nikšić) in branch 'master': bpo-34476: Document that asyncio.sleep() always suspends. (#9643) https://github.com/python/cpython/commit/cd602b8af2d14ff686261eeb18b80f718bb16550

[issue34476] asyncio.sleep(0) not documented

2018-09-30 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: Agreed about the special case. Minor change suggestion: ``sleep()` always suspends the current task, allowing other tasks to run. That is, replace "switches execution to another [task]" because there might not be other tasks or they might not be

[issue34476] asyncio.sleep(0) not documented

2018-09-30 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +9035 stage: -> patch review ___ Python tracker ___ ___

[issue34476] asyncio.sleep(0) not documented

2018-09-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: Adding "`asyncio.sleep()` always pauses the current task and switches execution to another one" sounds totally reasonable to me (without mentioning zero `delay` special case). Would you make a pull request? --

[issue34476] asyncio.sleep(0) not documented

2018-09-30 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: The issue is because the current documentation *doesn't* say that "`asyncio.sleep()` always pauses the current task and switches execution to another one", it just says that it "blocks for _delay_ seconds". With that description a perfectly valid

[issue34476] asyncio.sleep(0) not documented

2018-09-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: `asyncio.sleep()` always pauses the current task and switches execution to another one. `asyncio.sleep(0)` has no special meaning (but it has internal optimization for the case). Basically the same as `time.sleep(0)` for multithreaded program. I doubt if

[issue34476] asyncio.sleep(0) not documented

2018-09-22 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34476] asyncio.sleep(0) not documented

2018-08-23 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: Also, the "Create a coroutine ..." wording in the current documentation is a bit strange - sleep() is already marked as a coroutine, and documentation of other coroutines simply state their effect in imperative. --

[issue34476] asyncio.sleep(0) not documented

2018-08-23 Thread Hrvoje Nikšić
New submission from Hrvoje Nikšić : Looking at the implementation and at the old issue at https://github.com/python/asyncio/issues/284 shows that asyncio.sleep special-cases asyncio.sleep(0) to mean "yield control to the event loop" without incurring additional overhead of sleeping. However,