#NEWLINE# def _iterencode( self , o , markers = None ) : #NEWLINE# #INDENT# if isinstance ( o , ( str , unicode ) ) : #NEWLINE# #INDENT# if self . ensure_ascii : #NEWLINE# #INDENT# encoder = encode_basestring_ascii #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# encoder = encode_basestring #NEWLINE# #UNINDENT# ( yield encoder ( o ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( o is None ) : #NEWLINE# #INDENT# ( yield 'null' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( o is True ) : #NEWLINE# #INDENT# ( yield 'true' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( o is False ) : #NEWLINE# #INDENT# ( yield 'false' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( o , ( int , long ) ) : #NEWLINE# #INDENT# ( yield str ( o ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( o , float ) : #NEWLINE# #INDENT# ( yield floatstr ( o , self . allow_nan ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( o , ( list , tuple ) ) : #NEWLINE# #INDENT# for chunk in self . _iterencode_list ( o , markers ) : #NEWLINE# #INDENT# ( yield chunk ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( o , dict ) : #NEWLINE# #INDENT# for chunk in self . _iterencode_dict ( o , markers ) : #NEWLINE# #INDENT# ( yield chunk ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( markers is not None ) : #NEWLINE# #INDENT# markerid = id ( o ) #NEWLINE# if ( markerid in markers ) : #NEWLINE# #INDENT# raise ValueError ( 'Circular reference detected' ) #NEWLINE# #UNINDENT# markers [ markerid ] = o #NEWLINE# #UNINDENT# for chunk in self . _iterencode_default ( o , markers ) : #NEWLINE# #INDENT# ( yield chunk ) #NEWLINE# #UNINDENT# if ( markers is not None ) : #NEWLINE# #INDENT# del markers [ markerid ]