JMK no matter what

PyCon #5: Maximizing your program's laziness

기본적으로 거의 다 아는 얘기였다. -.-;

  • iterator
  • generator
  • itertools; imap, islice
  • Promise 클래스: partial 이나 Functor 클래스랑 비슷하네 -.- it memoizes output.
    • 아 hasattr
  • LazyDict 클래스: Promise 를 집어넣으면 꺼낼 때는 값을 계산해서 돌려 준다. 집어넣을 때는 시간이 안 걸림.
  • Use weakref() to forget it
  • memoize() for decorators (trading memory for time)
  • Suppose a DAG of Promises; it depends on the values of their parents
  • If we never ask for something, then it will never be calculated
  • challenges
    • If the value of one var changes, everything dependent on that will be invalidated: it will invalidate all its children.
    • we could change the structure of the graph
2010-02-20 05:43:26 | JM | /after/conferences/ | 0 Comments

Leave a comment

春來不似春

About

Eventstream

Pages

Guestbook

Search

Site Admin

Recent Comments