擅长:python、mysql、java
<p>我推荐一种类似<a href="https://stackoverflow.com/a/16332430/1561176">Volatility's.</a>的方法</p>
<p>但也使用<a href="https://stackoverflow.com/a/1988826/1561176">Memoization decorator</a>。(只有在期望多个相同值时才真正有用)</p>
^{1}$
<p>来源:<a href="http://code.activestate.com/recipes/578231-probably-the-fastest-memoization-decorator-in-the-/" rel="nofollow noreferrer">Memodict</a></p>