#NEWLINE# def test_Iterable( self ) : #NEWLINE# #INDENT# non_samples = [ None , 42 , 3.14 , 1j ] #NEWLINE# for x in non_samples : #NEWLINE# #INDENT# self . assertNotIsInstance ( x , Iterable ) #NEWLINE# self . assertFalse ( issubclass ( type ( x ) , Iterable ) , repr ( type ( x ) ) ) #NEWLINE# #UNINDENT# samples = [ str ( ) , tuple ( ) , list ( ) , set ( ) , frozenset ( ) , dict ( ) , dict ( ) . keys ( ) , dict ( ) . items ( ) , dict ( ) . values ( ) , ( lambda : ( yield ) ) ( ) , ( x for x in [ ] ) ] #NEWLINE# for x in samples : #NEWLINE# #INDENT# self . assertIsInstance ( x , Iterable ) #NEWLINE# self . assertTrue ( issubclass ( type ( x ) , Iterable ) , repr ( type ( x ) ) ) #NEWLINE# #UNINDENT# class I ( Iterable ) : #NEWLINE# #INDENT# def __iter__( self ) : #NEWLINE# #INDENT# return super ( I , self ) . __iter__ ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . assertEqual ( list ( I ( ) ) , [ ] ) #NEWLINE# self . assertFalse ( issubclass ( str , I ) ) #NEWLINE# self . validate_abstract_methods ( Iterable , '__iter__' ) #NEWLINE# self . validate_isinstance ( Iterable , '__iter__' )