#NEWLINE# def __eq__( self , other ) : #NEWLINE# #INDENT# w = self . items #NEWLINE# if isinstance ( w , ( list , tuple ) ) : #NEWLINE# #INDENT# for i in w : #NEWLINE# #INDENT# if ( i not in other ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# return True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( w , dict ) : #NEWLINE# #INDENT# for ( key , value ) in w . items ( ) : #NEWLINE# #INDENT# if ( other . get ( key , object ( ) ) != value ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# return True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( 'a dict or a list is required' )