On Fri, Apr 9, 2010 at 4:54 PM, Joakim Hove <joakim.h...@gmail.com> wrote: > I have never really got very friendly with exceptions, I tend to > consider them as something exceptional which "should not" happen, > whereas the fact that the database does not contain a particular key > is in my opinion something quite ordinary and not by any means > "exceptional".
Exceptions (despite the name) are absolutely *not* "exceptional" in Python; they're the standard idiom for handling all sorts of things. The "Pythonic" idea isn't "Look Before You Leap" (check first, then act); it's instead "Easier to Ask Forgiveness than Permission" (try to do something, and handle failure if it does happen). Love your exceptions; they're friendly (and quite useful) beasts. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.