Ah. I'll follow you with that. Thanks,
Dick On Thu, Sep 1, 2011 at 15:42, Chris Fuller <cfuller...@thinkingplanet.net> wrote: > 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 > _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor