#NEWLINE# def test_Hashable( self ) : #NEWLINE# #INDENT# non_samples = [ list ( ) , set ( ) , dict ( ) ] #NEWLINE# for x in non_samples : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# samples = [ None , int ( ) , float ( ) , complex ( ) , str ( ) , tuple ( ) , frozenset ( ) , int , list , object , type ] #NEWLINE# for x in samples : #NEWLINE# #INDENT# self . assertIsInstance ( x , Hashable ) #NEWLINE# self . assertTrue ( issubclass ( type ( x ) , Hashable ) , repr ( type ( x ) ) ) #NEWLINE# #UNINDENT# self . assertRaises ( TypeError , Hashable ) #NEWLINE# class H ( Hashable ) : #NEWLINE# #INDENT# def __hash__( self ) : #NEWLINE# #INDENT# return super ( H , self ) . __hash__ ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . assertEqual ( hash ( H ( ) ) , 0 ) #NEWLINE# self . assertFalse ( issubclass ( int , H ) ) #NEWLINE# self . validate_abstract_methods ( Hashable , '__hash__' ) #NEWLINE# self . validate_isinstance ( Hashable , '__hash__' )