Last active
December 14, 2015 20:48
-
-
Save earthling-shruti/5145952 to your computer and use it in GitHub Desktop.
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
#------------------------ | |
#in else block | |
try: | |
obj = db.create_obj(): | |
except DBExploded as e: | |
fail, return | |
else: | |
#obj is guarenteed to be valid object | |
obj.do_something() | |
obj.save() | |
#------------------------ | |
#not in else block | |
try: | |
obj = db.create_obj(): | |
except DBExploded as e: | |
fail, return | |
#obj is guarenteed to be valid object | |
obj.do_something() | |
obj.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment