Monthly Archives: 04月 2010

Fellow Fashion or Kept yourself

KeyWord: Information Storm.
iPhoneOs 4.0 will release soon, 仅从版本号的变更, 我们就应该能想得到会是一个什么样的变更. 或者是革新。
Programmer may want to write code once and run ok for whole time  of his living.  of course, it is a dream.
But we can write  more less rewrite and more reuseable code.  what i mean is to kept yourself some, and adapt  fashion some. 
The evil is internet information transport  mainly by copy and paste, so one [...]

why weakref?

a = classa()  # a is an class
b = a
a = None
what is the value of b?  (answer is  address of  instance a).
if you run the code , you will know what i want to talk about.  yeah,  we can use weakref to resolve this problem.
and clean python object completely. 
we replace  b = a of  b = weakref.ref(a)