On Thu, 30 Apr 2020 at 00:37, Raymond Hettinger <[email protected]> wrote: > > > > > On Apr 29, 2020, at 4:20 PM, Antoine Pitrou <[email protected]> wrote: > > > > On Wed, 29 Apr 2020 12:01:24 -0700 > > Raymond Hettinger <[email protected]> wrote: > >> > Also, if you know of a real world use case, what solution is currently being > used. I'm not sure what alternative call_once() is competing against.
Of course this is meant to be something simple - so there are no "real world use cases" that are "wow, it could not have been done without it". I was one of the first to reply to this on "python-ideas", as I often need the pattern, but seldon worrying about rentrancy, or parallel calling. Most of the uses are just that: initalize a resource lazily, and just "lru_cache" could work. My first thought was for something more light-weight than lru_cache (and a friendlier name). So, one of the points I'd likely have used this is here: https://github.com/jsbueno/terminedia/blob/d97976fb11ac54b527db4183497730883ba71515/terminedia/unicode.py#L30 > _______________________________________________ > Python-Dev mailing list -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/[email protected]/message/Y2MUKYDCV53PBWRRBU4ZAKB5XED4X4HX/ > Code of Conduct: http://python.org/psf/codeofconduct/ _______________________________________________ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/DJMIZ7Q3ZD5IKOOB73SEZNFVEAN34RMW/ Code of Conduct: http://python.org/psf/codeofconduct/
