On Thursday 01 September 2011, Richard D. Moores wrote:
> On Thu, Sep 1, 2011 at 12:29, Chris Fuller
> 
> <cfuller...@thinkingplanet.net> wrote:
> > *Ahem*
> > 
> > def is_hashable(object):
> >   try:
> >        hash(object)
> >    except TypeError:
> >        return False
> > 
> >    return True
> 
> Why is that preferred to
> 
> def is_hashable(object):
>     try:
>         hash(object)
>         return True
>     except TypeError:
>         return False
> 
> ??
> 
> Dick

It's a style issue, really.  Either would be fine, but I don't like mixing 
code-flow disrupting actions when it's easily avoided.

Cheers
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to