def date_sorted_sources(*sources):
 sorted_stream = heapq.merge(*(_decorate_source(s) for s in sources))
 for (_, message) in sorted_stream:
  (yield message)

def date_sorted_sources ( * sources ) : sorted_stream = heapq . merge ( * ( _decorate_source ( s ) for s in sources ) ) for ( _ , message ) in sorted_stream : ( yield message )
takes an iterable of sources .