Hi,<br><br>I've a list of python objects with dates attributes. This list is ordered by one of these date. Elements mandatory follow each other :<br><br><span style="font-family:courier new,monospace">Element #1 Element #2 Element #3</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">|-------------------------|--------------|--------------------------|</span><br><br>Now, I want to "insert" an element in this timeline. This imply that I will have to resize some elements :<br>
<br><span style="font-family:courier new,monospace">Element #1 Element #2 Element #3</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">|-------------------------|--------------|--------------------------|</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> New element</span><br>
<span style="font-family:courier new,monospace"> |----------------------|</span><br><br>And after resize :<br><br><span style="font-family:courier new,monospace">Element #1 </span><span style="font-family:courier new,monospace">New element</span><span style="font-family:courier new,monospace"> Element #2 Element #3</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">|---------|----------------------|---------|--------------------------|</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> </span><br>
<span style="font-family:courier new,monospace"> |----------------------|</span><br><br>My question is the following : how can I know (easily) which elements my "New element" is "over", which,<br>
in my example would have returned ['Element #1', 'Element #2'].<br><br>Elements objets are simple Python objects with dates :<br><br>obj.begin = datetime()<br>obj.end = datetime()<br><br>I'm looking for the more Pythonic way to handle this problem, thanks !<br>
<br><br>