def dn2str(dn):
 return ','.join(['+'.join(['='.join((atype, escape_dn_chars((avalue or '')))) for (atype, avalue, dummy) in rdn]) for rdn in dn])

def dn2str ( dn ) : return ',' . join ( [ '+' . join ( [ '=' . join ( ( atype , escape_dn_chars ( ( avalue or '' ) ) ) ) for ( atype , avalue , dummy ) in rdn ] ) for rdn in dn ] )
this function takes a decomposed dn as parameter and returns a single string .