Python - anyone have a memoizing decorator that can handle unhashable arguments?

后端 未结 5 1928
情书的邮戳
情书的邮戳 2020-11-29 03:09

I\'ve been using the following memoizing decorator (from the great book Python Algorithms: Mastering Basic Algorithms in the Python Language ... love it, btw).



        
5条回答
  •  旧时难觅i
    2020-11-29 03:44

    I've searched and have found a good python package.

    https://pypi.org/project/memoization/

    • easy to use
    • possible to use unhashable arguments
    • other useful option (time to live)

提交回复
热议问题