bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [task] [WIP]#13670
bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [task] [WIP]#13670eamanu wants to merge 3 commits intopython:masterfrom
Conversation
This PR deprecate explicit loop parameters in all public asyncio APIs This issues is split to be easier to review. First step: tasks.py
tirkarthi
left a comment
There was a problem hiding this comment.
Please handle DeprecationWarning in the tests. Running with -Werror would give test failures due to warnings.
asvetlov
left a comment
There was a problem hiding this comment.
Agree with @tirkarthi
./python -Werror -m test should pass
You can find the following command useful in development:
`./python -Werror -m test -v test_asyncio"
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be poked with soft cushions! |
asvetlov
left a comment
There was a problem hiding this comment.
Please run the PR with ./python -Werror -m test --check-env-changed -v test_asyncio and make sure that the test run is succeded.
Lib/asyncio/tasks.py
Outdated
| """ | ||
|
|
||
| def __init__(self, children, *, loop=None): | ||
| if loop: |
There was a problem hiding this comment.
This check is redundant: asyncio.gather() always passes loop to internal _GatheringFuture constructor.
Lib/asyncio/tasks.py
Outdated
|
|
||
| def __init__(self, coro, *, loop=None, name=None): | ||
| if loop: | ||
| warnings.warn("The loop argument is deprecated since Python 3.8, " |
There was a problem hiding this comment.
Task is called with explicit loop by loop.create_task() method, please drop the check
Codecov Report
@@ Coverage Diff @@
## master #13670 +/- ##
==========================================
- Coverage 82.78% 82.78% -0.01%
==========================================
Files 1842 1842
Lines 559265 559276 +11
Branches 41382 41387 +5
==========================================
- Hits 463009 462990 -19
- Misses 87188 87209 +21
- Partials 9068 9077 +9
Continue to review full report at Codecov.
|
|
The work is merged as a part of #16033 |
This PR deprecate explicit loop parameters in all public asyncio APIs
This issues is split to be easier to review.
First step: tasks.py
https://bugs.python.org/issue36373