[Python-ideas] Make asyncio.get_event_loop a builtin

2018-05-22 Thread Ken Hilton
Hi all, Just a simple idea I wanted to bring forth. Although I know that you get a lot more asyncio control by importing the asyncio module itself, I'd like to see a way to make simple asynchronous applications without ever importing asyncio itself. To that end, I propose making asyncio.get_event_

Re: [Python-ideas] Make asyncio.get_event_loop a builtin

2018-05-22 Thread Terry Reedy
On 5/22/2018 5:21 AM, Ken Hilton wrote: Hi all, Just a simple idea I wanted to bring forth. Although I know that you get a lot more asyncio control by importing the asyncio module itself, I'd like to see a way to make simple asynchronous applications without ever importing asyncio itself. To

Re: [Python-ideas] Make asyncio.get_event_loop a builtin

2018-05-22 Thread Yury Selivanov
On Tue, May 22, 2018 at 2:09 PM Terry Reedy wrote: [..] > I like the idea of making coroutines easier and use. It would make more > sense to me to expose an eventloop class as a builtin, so that one would > write > eventloop().run_until_complete(hello) > eventloop would not necessarily have to

Re: [Python-ideas] Make asyncio.get_event_loop a builtin

2018-05-22 Thread Chris Barker via Python-ideas
>>To that end, I propose making asyncio.get_event_loop() a builtin. I like the idea of making coroutines easier and use. I do too, but ... > > Eventloop could have an .__init__ method, or be a factory function, with a > 'loop' parameter. The value specifies which eventloop implementation > a

Re: [Python-ideas] Make asyncio.get_event_loop a builtin

2018-05-24 Thread Ken Hilton
On Tue May 22 22:08:40 (-0400), Chris Barker wrote: > while asyncio is in the standard library, it is not intended to be THE async event loop implementation I'm surprised this is true - with dedicated syntax like async def/await, it's still not THE async event loop implementation? As far as I know

Re: [Python-ideas] Make asyncio.get_event_loop a builtin

2018-05-25 Thread João Santos
Hi, You can use uvloop , for example, without using asyncio: import uvloop loop = uvloop.new_event_loop() loop.run_forever() Best regards, João Santos On Fri, 25 May 2018 at 02:42, Ken Hilton wrote: > On Tue May 22 22:08:40 (-0400), Chris Barker wrote: >

Re: [Python-ideas] Make asyncio.get_event_loop a builtin

2018-05-25 Thread Mark E. Haase
asyncio.coroutine and async def are slightly different—not synonyms. The former defines a generator function and the latter defines a coroutine function. Generators and coroutines are very similar in Python (they share lots of code in the CPython implementation) but coroutines are preferred for asy

Re: [Python-ideas] Make asyncio.get_event_loop a builtin

2018-06-05 Thread Michel Desmoulin
Well that doesn't matter anyway. With breakpoint() we choose the debugger implementation, so we could do the same here. However, this would be addressing the wrong problem the problem is verbosity. asyncio s are already aware of that, since they are working on providing asycio.run() in 3.7. Now t