On Sun, Apr 26, 2020 at 09:58:46PM -0400, Dan Sommers wrote:
How many beginners do you know who even know what a LRU cache is?
The same number of beginners who know to look in functools for a decorator called once?
Look in *functools* at all? Probably not that many. Google for "how do I execute a function only once" rather than "lru_cache"? Many, many more. I'm not opposed to jargon when it is appropriate. I don't want to change the name of the lru_cache! But if we have the opportunity for a functional enhancement, why wouldn't we prefer a name which is: - plain English, not jargon - memorable - self-descriptive - describes *what* you want to do rather than *how* you want to do it - and matches the terminology used by other languages and libraries? Possibly "run_once" is even more descriptive. It avoids the "run once versus define once" trap that Ethan mentioned, and is more accurate than the C++ name "call_once". https://stackoverflow.com/questions/50904087/run-a-function-only-once-during... -- Steven