On 29/09/2022 07.22, Robert Latest via Python-list wrote:
...
> This is what I came up with. I'm quite happy with it so far. Question: Am I
> being too clever? is it too complicated? Am I overlooking something that will
> come back and bite me later? Thanks for any comments!
Thank you for the ch
On Thu, 29 Sept 2022 at 05:36, Robert Latest via Python-list
wrote:
> in a (Flask) web application I often find that many equal (SQLAlchemy) queries
> are executed across subsequent requests. So I tried to cache the results of
> those queries on the module level like this:
>
> @lru_cache()
>
Hi all,
in a (Flask) web application I often find that many equal (SQLAlchemy) queries
are executed across subsequent requests. So I tried to cache the results of
those queries on the module level like this:
@lru_cache()
def query_db(db, args):
# do the "expensive" query
r
Meredith Montgomery writes:
> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>
>> Meredith Montgomery writes:
>>>Is that at all possible somehow? Alternatively, how would you do your
>>>toy oop-system?
>>
>> Maybe something along those lines:
>>
>> from functools import partial
>>
>> def counte