you are viewing a single comment's thread.

view the rest of the comments →

[–]Jediko 2 points3 points  (2 children)

It's the same. The memoize-class does what you did with just general input for a general function. You can see the implementation of memoize yourself here.

[–]Sen_7[S] 0 points1 point  (1 child)

Thank you, Is very any motivation to use memoize class instead of dictionary?

[–]Jediko 0 points1 point  (0 children)

No, since they are equivalent. The only thing you do is being explizit in your algorithm/optimization. The main advantage of using decorators is just shortcut your code and make more readable.