Created
October 15, 2011 05:30
-
-
Save troter/1289101 to your computer and use it in GitHub Desktop.
finally timing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% python [31909] | |
Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01) | |
[GCC 4.3.4 20090804 (release) 1] on cygwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> def g(): | |
... try: | |
... yield 1 | |
... finally: | |
... print "finished" | |
... | |
>>> g().next() | |
finished | |
1 | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment