{"action":"opened","issue":{"url":"https://api.github.com/repos/chaimleib/intervaltree/issues/37","repository_url":"https://api.github.com/repos/chaimleib/intervaltree","labels_url":"https://api.github.com/repos/chaimleib/intervaltree/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/chaimleib/intervaltree/issues/37/comments","events_url":"https://api.github.com/repos/chaimleib/intervaltree/issues/37/events","html_url":"https://github.com/chaimleib/intervaltree/issues/37","id":136068053,"number":37,"title":"symmetric_difference_update raises a RuntimeError","user":{"login":"ProgVal","id":406946,"avatar_url":"https://avatars.githubusercontent.com/u/406946?v=3","gravatar_id":"","url":"https://api.github.com/users/ProgVal","html_url":"https://github.com/ProgVal","followers_url":"https://api.github.com/users/ProgVal/followers","following_url":"https://api.github.com/users/ProgVal/following{/other_user}","gists_url":"https://api.github.com/users/ProgVal/gists{/gist_id}","starred_url":"https://api.github.com/users/ProgVal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProgVal/subscriptions","organizations_url":"https://api.github.com/users/ProgVal/orgs","repos_url":"https://api.github.com/users/ProgVal/repos","events_url":"https://api.github.com/users/ProgVal/events{/privacy}","received_events_url":"https://api.github.com/users/ProgVal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-24T13:55:33Z","updated_at":"2016-02-24T13:55:33Z","closed_at":null,"body":"Hi,\r\n\r\n`symmetric_difference_update` updates the current tree while iterating on it, which raises a RuntimeError.\r\n\r\n```python\r\n$ PYTHONHASHSEED=0 python3\r\nPython 3.4.2 (default, Oct  8 2014, 10:45:20) \r\n[GCC 4.9.1] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> from intervaltree import IntervalTree, Interval\r\n>>> t1 = IntervalTree({Interval(1, 2), Interval(2, 3), Interval(3, 4)})\r\n>>> t2 = IntervalTree({Interval(3, 4)})\r\n>>> t1.symmetric_difference_update(t2)\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/home/progval/.local/lib/python3.4/site-packages/intervaltree/intervaltree.py\", line 456, in symmetric_difference_update\r\n    for iv in self:\r\nRuntimeError: Set changed size during iteration\r\n```\r\n\r\nNote that this error will not happen if the only modification happens on the last iteration.\r\n\r\nVersion: 2.1.0, from PyPI."}}