Re: Asynchronous processing is more efficient -- surely not?

2018-04-04 Thread Julien Salort
Le 04/04/2018 à 14:45, Chris Angelico a écrit : Can you give an example? Let's say we have a simple blocking C function: int get_data() { sleep(2); return 42; } I am not saying that I understand 100% and that this is the best way, but it works for me: % cat get_data.c #include i

Re: Asynchronous processing is more efficient -- surely not?

2018-04-04 Thread Julien Salort
Le 04/04/2018 à 09:27, Steven D'Aprano a écrit : Yes, this exactly. And if you're writing a web app, or certain kinds of desktop apps, these seems sensible. I don't want my browser to come to a complete halt just because some resource is taking a few seconds to respond. But honestly, from every

Re: Make synchronous generator from an asynchronous generator

2018-03-16 Thread Julien Salort
Le 16/03/2018 à 16:55, Ian Kelly a écrit : Note that this function can't be called more than once, because it closes the event loop at the end. Next time you call it it will get the closed event loop and try to schedule on it and then raise an exception because it's closed. Ah ok. So, if I repl

Make synchronous generator from an asynchronous generator

2018-03-16 Thread Julien Salort
Hello, I have recently got the need to convert a synchronous function to asynchronous function because I needed to run three of them concurrently. Since I am using Python 3.6, I used async def and asyncio and that has worked out great. Thank you guys for making this possible. Because I want

Re: Spectre/Meltdown bug affecting Python ?

2018-01-07 Thread Julien Salort
Le 06/01/2018 à 21:49, J.O. Aho a écrit : Not just Linux, but all other OS:es, Microsoft and Apple been patching in secret as they have a closed source approach, but ms-windows needs at least one more patch before it can breath out, which will be released on Tuesday. As a matter of fact, Apple

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Julien Salort
Le 12/10/2017 à 17:57, bartc a écrit : With a const struct, you are stopped from directly modifying elements, but if an element is a pointer, nothing stops you writing to what the pointer points to, unless that has a const target too. And then you've going to have problems doing normal updates

Re: Why not allow empty code blocks?

2016-08-02 Thread Julien Salort
ufficiently complex programs for it to become totally unreadable. -- Julien Salort Entia non sunt multiplicanda praeter necessitatem http://www.juliensalort.org -- https://mail.python.org/mailman/listinfo/python-list

Re: Bulk Adding Methods Pythonically

2016-06-16 Thread Julien Salort
s > Yes, returning the class namespace is a language gaurantee. But that says: "Note The contents of this dictionary should not be modified; changes may not affect the values of local and free variables used by the interpreter." -- Julien Salort Entia non sunt multiplicanda

Re: I'm wrong or Will we fix the ducks limp?

2016-06-09 Thread Julien Salort
= A; B->x = 3; B->y = 4; which backs indeed the C pointer analogy... -- Julien Salort Entia non sunt multiplicanda praeter necessitatem http://www.juliensalort.org -- https://mail.python.org/mailman/listinfo/python-list