Using a background thread with asyncio/futures with flask

2024-03-20 Thread Thomas Nyberg via Python-list
Hello, I have a simple (and not working) example of what I'm trying to do. This is a simplified version of what I'm trying to achieve (obviously the background workers and finalizer functions will do more later): `app.py` ``` import asyncio import threading import time from queue import

Re: Configuring an object via a dictionary

2024-03-20 Thread Dan Sommers via Python-list
On 2024-03-20 at 09:49:54 +0100, Roel Schroeven via Python-list wrote: > You haven't only checked for None! You have rejected *every* falsish value, > even though they may very well be acceptable values. OTOH, only you can answer these questions about your situations. Every application, every

Re: Configuring an object via a dictionary

2024-03-20 Thread Roel Schroeven via Python-list
Op 19/03/2024 om 0:44 schreef Gilmeh Serda via Python-list: On Mon, 18 Mar 2024 10:09:27 +1300, dn wrote: > YMMV! > NB your corporate Style Guide may prefer 'the happy path'... If you only want to check for None, this works too: >>> name = None >>> dafault_value = "default" >>> name or

Re: GIL-Removal Project Takes Another Step (Posting On Python-List Prohibited)

2024-03-20 Thread Chris Angelico via Python-list
On Wed, 20 Mar 2024 at 18:31, Greg Ewing via Python-list wrote: > > On 20/03/24 4:14 pm, Lawrence D'Oliveiro wrote: > > not to > > mention the latency when there isn’t quite enough memory for an allocation > > and you have to wait until the next GC run to proceed. Run the GC a > > thousand times

Re: GIL-Removal Project Takes Another Step (Posting On Python-List Prohibited)

2024-03-20 Thread Greg Ewing via Python-list
On 20/03/24 4:14 pm, Lawrence D'Oliveiro wrote: not to mention the latency when there isn’t quite enough memory for an allocation and you have to wait until the next GC run to proceed. Run the GC a thousand times a second, and the latency is still 1 millisecond. That's not the way it usually