Oxfam America banner

Wednesday, November 5, 2008

finally

I always thought I understand `finally' in the context of exception handling in either Java or Python. Now, I'm not sure I really understand it. Riddle: What does the following print?




def f():
try:
return 1
finally:
return 2
print f()


Ah ... never mind ... I understand it again now. It means: finally.

0 comments:

Post a Comment