タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

Pythonとmemoizeに関するsyanbiのブックマーク (2)

  • IncPy: Automatic memoization for Python

    What is IncPy? IncPy (Incremental Python) is an enhanced Python interpreter that speeds up script execution times by automatically memoizing (caching) the results of long-running function calls and then re-using those results rather than re-computing when safe to do so. When you first run your script with the IncPy interpreter, it might be ~20% slower since IncPy needs to determine which functions

    syanbi
    syanbi 2010/07/03
    結果をキャッシュする仕組みらしい。あとで試す。
  • decoratorとかmemoizeとか - 初学者の箸置

    ふと python の decorator が気になってきていろいろ考える。@staticmethod って何やってるんだろうとか。 decoratorとは decoratorってのは基的には @dec def foo(): pass だったら def foo(): pass foo = dec(foo) しているだけだそうだから、要するにそういう関数をこねくれば良いのだよな。 staticmethodをミミック def stm(f): return lambda self, *args: sys.stdout.write("my static method\n") or f(*args) 式でシーケンスを書く方法がわからない。writeの特性を悪用してorってみた。 どうかな。 In [275]: class some(object): @stm def foo(): print "s

    decoratorとかmemoizeとか - 初学者の箸置
  • 1