Ryan is an engineer in the Sacramento Area with a focus in Python, Ruby, and Rust. Bash/Python Exercism mentor. Coding, physics, calculus, music, woodworking. Looking for work!
It's pretty much the same. There are a couple benefits though.
You don't have to write your own memoization function. You get to use one that has already been error checked, optimized for efficiency, and merged into the standard library. It's got Guido's stamp of approval 👍🏻
LRU cache comes with an additional maxsize parameter which can help with tuning for memory management (i.e. not growing your cache to infinity). Setting maxsize to 0 effectively gives you a basic memoization decorator.
You don't have to write it, you don't have to write tests for it, you don't have to maintain it, you don't have to write docs for it. The easiest code to debug is the code that never gets written.
There are probably benefits to writing your own too though. Just depends on what you want.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It's pretty much the same. There are a couple benefits though.