Re:Python: Uncovering the Overlooked Core Functionalities
by hangonhn on Monday July 24, 2023 @05:09PM
(#36854232)
Yeah. I was really surprised to see this as a feature to be used rather than a gotcha. I've seen it more as gotchas, as in actual bugs introduced because of this behavior, and never as a feature until now. I can see why he thinks it's useful though and, maybe within his specific context, it is. That said, even for his example, I think he would have been better off using https://docs.python.org/3/library/functools.html#functools.c...
[ Parent
| on HN ]
Re:Python: Uncovering the Overlooked Core Functionalities
by erikvdven on Tuesday July 25, 2023 @03:36PM
(#36868153)
You are right about that, perhaps it is good to mention it as "gotcha". Or I could have used a better title. I do think though, it is good practice to know this stuff. About the cache decorator: I did link to another article where I discuss lru_cache and cache :)