I am trying to build a list of backpointers. In there, I want to avoid duplicates. As far as i know i cant use a dict or set, because the items to be stored are not hashable. I implented the following code:
while k in range(limit):try:if path notin path_backp:
the part to avoid double entities of course is:
if path notin path_backp:
Im running python inside TestComplete, which has (limited) debugging functions. When I enable the debugger and track what is happening, the first check works. The if-routine gets executed, and because path_backp is an empty dict, path gets appended, so that afterwards path_backp[0] equals path and I get back to to the while-routine. But when the if-routine gets executed the 2nd time (so when path_backp is no empty dict anymore), the debugger freezes for what seems an infinite amount of time. same happens, by the way, when I implemented:
if path notin path_backp:
without any continue or else. Can anyone explain to me why this is happening and how I can handle the situation? Many thanks,
t. |
↧
[python] check for 'item not in mylist' causes TestComplete to crash
↧