
今早上班沿途所見,異象不是日全蝕,而是平日朝早在中環見九成人都頭耷耷,今朝早卻一反常態,人人頭顎顎。
太陽太刺眼,當我抬頭望天,甚麼也望不到的時候,腦海出現了上圖的情景。
Suppose that you have the Python try:/finally: problem and need to get around it, specificallyyou need to both be a generator and have your finally: runimmediately. Taken from here ,one answer is:
def foo(bar): try: def output(): ... compute with bar ... yield res ... return output() finally: print "finalizing"
(Now, there is a lot of things that this doesn't help with; the actualcomputation
Due to another entry I'm in the process of writing, I was suddenlystruck with a question: in Python, when does the code in a generatorfunction start running?
First, the brief version of generators and iterators. To handwavesomewhat, a generator is a function that uses yield to create andreturn its results one at a time. Behind the scenes, such a functionactually returns an iterator object, which the Python interpreter usesto freeze and unfreeze the actual code as the function's code calls

One of the accidental smart decisions that I made when I was writing DWiki 's code for syndication feeds was that I should create syndicationfeeds for comments as well as entries. (This built on an earlierdecision that I should have some way of getting a list of comments inchronological order, just as I had one for the standard wiki 'recentlyedited pages' feature.)
It isn't that I think this is an important feature to offer otherpeople; as far as I know, none of the

今早上班沿途所見,異象不是日全蝕,而是平日朝早在中環見九成人都頭耷耷,今朝早卻一反常態,人人頭顎顎。
太陽太刺眼,當我抬頭望天,甚麼也望不到的時候,腦海出現了上圖的情景。