title: How to find two close events (that have a datetime component) in python
body: <p>I have an object that represents an event, and I have many types of those objects.</p>
  
  <p>I want to find events that are close in time in python.</p>
  
  <p>The nicest way I could find to do it is:</p>
  
  <pre><code>joined_events = [[event_a.time, event_a.description, event_b.time, event_b.description] for event_a in events_a for event_b in events_b if abs(event_a.time - event_b.time) &lt; datetime.timedelta(hours = 1)]
  </code></pre>
  
  <p>But I hoped there was a better method of doing it.</p>