#NEWLINE# def tsplit( string , delimiters ) : #NEWLINE# #INDENT# 'Behaves str.split but supports tuples of delimiters.' #NEWLINE# delimiters = tuple ( delimiters ) #NEWLINE# if ( len ( delimiters ) < 1 ) : #NEWLINE# #INDENT# return [ string ] #NEWLINE# #UNINDENT# final_delimiter = delimiters [ 0 ] #NEWLINE# for i in delimiters [ 1 : ] : #NEWLINE# #INDENT# string = string . replace ( delimiters , final_delimiter ) #NEWLINE# #UNINDENT# return string . split ( final_delimiter )