def _mixed_join(iterable, sentinel):
 iterator = iter(iterable)
 first_item = next(iterator, sentinel)
 if isinstance(first_item, bytes):
  return (first_item + ''.join(iterator))
 return (first_item + u''.join(iterator))

def _mixed_join ( iterable , sentinel ) : iterator = iter ( iterable ) first_item = next ( iterator , sentinel ) if isinstance ( first_item , bytes ) : return ( first_item + '' . join ( iterator ) ) return ( first_item + u'' . join ( iterator ) )
concatenate any string type in an intelligent way .