[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2017-08-18 Thread Guido van Rossum
Guido van Rossum added the comment: Let's not do this. -- resolution: -> rejected stage: test needed -> resolved status: open -> closed ___ Python tracker

[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2017-08-18 Thread Matt Rasband
Matt Rasband added the comment: I attempted this myself, it seemed to have too many costs associated for the stdlib and is something easy enough to wrap myself when I need this functionality with explicit semantics on how to "stop" the queue (using an `object()` sentinel). My implementation

[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2017-08-03 Thread Guido van Rossum
Guido van Rossum added the comment: So that's an infinite loop right? -- ___ Python tracker ___ ___

[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2017-08-03 Thread Georgy
Georgy added the comment: I successfully use my code: import asyncio, sanic class MyQueue(asyncio.Queue): def __aiter__(self): return self async def __anext__(self): return await self.get() app = sanic.Sanic() ws_set = set() app.static('/', 'async.html') @app.websocket('/ws') async

[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2017-07-25 Thread Guido van Rossum
Guido van Rossum added the comment: > > there's no way to end the loop on the producing side. > I might be missing something, but can't something similar be said of > queue.get()? That's my point, actually. If you are wrapping the Queue protocol with __aiter__/__anext__ the caller would

[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2017-07-25 Thread Chris Jerdonek
Chris Jerdonek added the comment: > there's no way to end the loop on the producing side. I might be missing something, but can't something similar be said of queue.get()? -- ___ Python tracker

[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2017-07-25 Thread Chris Jerdonek
Changes by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker ___ ___

[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2016-11-25 Thread Guido van Rossum
Guido van Rossum added the comment: Also it's not clear that it's a good idea without more thought -- there's no way to end the loop on the producing side. -- ___ Python tracker

[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2016-11-25 Thread Guido van Rossum
Guido van Rossum added the comment: This should be an upstream PR first (GitHub.com/python/asyncio). Also, too late for 3.6. -- versions: -Python 3.5, Python 3.6 ___ Python tracker

[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2016-11-25 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: -> test needed title: asinc iter queue -> Add asyncio.Queue __aiter__, __anext__ methods versions: +Python 3.6, Python 3.7 ___ Python tracker