The Samurai Principle
ian.g.kelly at gmail.com
Tue Sep 7 19:36:29 CEST 2010
On Tue, Sep 7, 2010 at 10:02 AM, Phlip <phlip2005 at gmail.com> wrote:
> Back to the topic, I tend to do this:
> for record in Model.objects.filter(pk=42):
> return record
> return sentinel
How is that any better than just catching the exception?
The flow of control is much clearer this way.
More information about the Python-list