This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients achimnol, asvetlov, rhettinger, serhiy.storchaka, uranusjr, yselivanov
Date 2022-02-24.16:03:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645718630.48.0.579466948362.issue46622@roundup.psfhosted.org>
In-reply-to
Content
[Andrew Svetlov]
> A third-party library should either copy all these 
> implementation details or import a private function from stdlib 

OrderedDict provides just about everything needed to roll lru cache variants.  It simply isn't true this can only be done efficiently in the standard library.


[Serhiy]
> it would be simpler to add a decorator which wraps the result 
> of an asynchronous function into an object which can be awaited
> more than once:

This is much more sensible.

> It can be combined with lru_cache and cached_property any third-party
> caching decorator. No access to internals of the cache is needed.

Right.  The premise that this can only be done in the standard library was false.

> async_lru_cache() and async_cached_property() can be written 
> using that decorator. 

The task becomes trivially easy :-)  


[Andrew Svetlov]
> Pull Request is welcome!

ISTM it was premature to ask for a PR before an idea has been thought through.  We risk wasting a user's time or committing too early before simpler, better designed alternatives emerge.
History
Date User Action Args
2022-02-24 16:03:50rhettingersetrecipients: + rhettinger, asvetlov, serhiy.storchaka, yselivanov, uranusjr, achimnol
2022-02-24 16:03:50rhettingersetmessageid: <1645718630.48.0.579466948362.issue46622@roundup.psfhosted.org>
2022-02-24 16:03:50rhettingerlinkissue46622 messages
2022-02-24 16:03:50rhettingercreate