(Apr-27-2017, 05:02 PM)micseydel Wrote: I've only ever seen it as a gotcha, including for experienced Python programmers, and have never actually seen this used for caching or anything like that (and I'd be reluctant to accept it as a good use case).Well, I have some experience, and though I've never seen it used by anyone else, I used it a couple of time. Does improving performance by 100-s of percents in resource-hogging time-critical apps count as a
good cause
(yes, occasionally improving performance counts, even in Python ).Of course, you have to keep in mind
- Cache maintenance - you may easily end up with memory leak
- You cannot re-assign cache - you may clean it, but you must preserve the reference
experienced Python programmer
, but I have some experience with programming...
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.