[Tutor] Is there a test for hashability?

Richard D. Moores rdmoores at gmail.com
Thu Sep 1 22:06:58 CEST 2011


def is_hashable(object):
    try:
        hash(object)
        return True
    except TypeError:
        return False

it is then. Thanks to all!

Dick


More information about the Tutor mailing list