What value does this function return?
January 2, 2009 in Uncategorized
What value does this function return? Java has the same behavior.
def test():
try:
return 0
finally:
return 1
About
A blog by Kevin Burton - Founder/CEO of web crawler and social media aggregation company Spinn3r.
Spinn3r News- Spinn3r Hiring Five new Engineers (and growing rapidly)
- Spinn3r Hiring Support Engineer
- NYTimes, on Memetracker, and Spinn3r
- Spinn3r at Real Time Stream Crunchup, RSS Speedups, and Startup Discounts
- Spinn3r Hiring Crawl Engineer
- Spinn3r 3.1 - Now with Twitter Support and Social Media Ranking
- Blogfa.com (Iranian Blog Network) Down Due to Iranian Protests and Civil Unrest?
- Papers using Spinn3r Data from ICWSM 2009
- Spinn3r talk from ICWSM 2009
- Spinn3r 3.0: New Features, New Architecture, New APIs - More Goodness
-
Top Posts
- Facebook and Ping - this is WHY we need an open social web.
- Using ON DUPLICATE KEY UPDATE to improve MySQL Replication Performance
- Why Doesn't MySQL support Millisecond DATETIME Resolution?
- Markus Frind, Founder of 'Plenty of Fish' - Either a Liar or a Fool
- Java and In-Memory Data Structures - A Flat File Map Proposal
- Google, Bigtable, Compression, Zippy and BMDiff
- Partitioning in MySQL 5.1 - Worth the Headache?
- More SSD vs HDD vs InnoDB vs MyISAM Numbers
- Facebook APIs are Open - Except if your too big.
- I Hate Nagios!
Archives
- September 2010
- August 2010
- June 2010
- May 2010
- April 2010
- March 2010
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
Blogroll
Meta
Subscribe
-
Flickr










More Photos


January 2, 2009 at 2:09 pm
in .Net you cannot have a return statement inside the finally block. it makes sense.
-Tamer
January 2, 2009 at 2:34 pm
1
January 2, 2009 at 3:00 pm
1
January 2, 2009 at 5:05 pm
Python returns 0.
January 2, 2009 at 5:07 pm
Sorry, it’s 1.
January 3, 2009 at 6:49 pm
I guessed “1″ before I tried it, and my guess held up. My internal reasoning was the old mnemonic from when I first learned Java years ago — “the ‘finally’ block runs NO MATTER WHAT”.
January 5, 2009 at 4:28 am
Ruby gives 1 too.