[issue47167] Allow overriding future-task compliance check in asyncio

2022-03-31 Thread Yury Selivanov


Yury Selivanov  added the comment:

Sorry, I don't like the committed change and I think it should be reverted.

Futures and Tasks have a documented `get_loop()` method which simply should be 
called by Task machinery, without the need to expose (and document) private 
methods.

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47167] Allow overriding future-task compliance check in asyncio

2022-03-31 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset d4bb38f82bf18b00db3129031ce4969b6f0caab9 by Andrew Svetlov in 
branch 'main':
bpo-47167: Allow overriding a future compliance check in asyncio.Task (GH-32197)
https://github.com/python/cpython/commit/d4bb38f82bf18b00db3129031ce4969b6f0caab9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47167] Allow overriding future-task compliance check in asyncio

2022-03-31 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47167] Allow overriding future-task compliance check in asyncio

2022-03-30 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
keywords: +patch
pull_requests: +30273
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32197

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47167] Allow overriding future-task compliance check in asyncio

2022-03-30 Thread Andrew Svetlov


New submission from Andrew Svetlov :

Now asyncio.Task has a strict hardcoded check for futures processes on task's 
step.
Sometimes third-party library [1] wants to replace it with custom logic.
Currently it is impossible without implementing the full asyncio.Task 
replacement from scratch.
`asyncio.Task` is a non-trivial highly optimized part of async, keeping a 
third-party version in sync with the reference implementation takes more time 
and effort than it should be.

This issue proposes adding `Task._check_future(future)` method that could be 
overridden in subclasses.  The default C implementation uses a fast path that 
has no performance penalty.

1. https://github.com/aio-libs/aioloop-proxy implements nested loop proxies 
that are very useful for writing tests. A proxy can work in parallel with 
ancestors but checks all own acquired resources cleanup on 
the proxy closing.

--
components: asyncio
messages: 416374
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Allow overriding future-task compliance check in  asyncio
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com