{"action":"opened","issue":{"url":"https://api.github.com/repos/ganga-devs/ganga/issues/184","repository_url":"https://api.github.com/repos/ganga-devs/ganga","labels_url":"https://api.github.com/repos/ganga-devs/ganga/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/ganga-devs/ganga/issues/184/comments","events_url":"https://api.github.com/repos/ganga-devs/ganga/issues/184/events","html_url":"https://github.com/ganga-devs/ganga/issues/184","id":132396060,"number":184,"title":"GangaList tests failing","user":{"login":"milliams","id":61316,"avatar_url":"https://avatars.githubusercontent.com/u/61316?v=3","gravatar_id":"","url":"https://api.github.com/users/milliams","html_url":"https://github.com/milliams","followers_url":"https://api.github.com/users/milliams/followers","following_url":"https://api.github.com/users/milliams/following{/other_user}","gists_url":"https://api.github.com/users/milliams/gists{/gist_id}","starred_url":"https://api.github.com/users/milliams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milliams/subscriptions","organizations_url":"https://api.github.com/users/milliams/orgs","repos_url":"https://api.github.com/users/milliams/repos","events_url":"https://api.github.com/users/milliams/events{/privacy}","received_events_url":"https://api.github.com/users/milliams/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ganga-devs/ganga/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/ganga-devs/ganga/labels/Core","name":"Core","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-09T11:30:03Z","updated_at":"2016-02-09T11:30:03Z","closed_at":null,"body":"Since 6.1.13 (and it got worse in 6.1.14) we've been failing on a number of `GangaList` tests which, after some investigation, needs some discussion. The primary bug I've come across is a change in how calling `copy` on a `GangaList` preserves references or not.\r\n\r\nIf you make a `GangaList` with:\r\n```python\r\ngl = GangaList()\r\ngl.append(LocalFile())\r\n```\r\nthen you have a `GangaList` with a single `LocalFile` in it. Calling:\r\n```python\r\ngl2 = copy.copy(gl)\r\n```\r\nshould, by normal Python convention, create a new `GangaList` where `id(gl) != id(gl2)` _but_ `id(gl[0]) == id(gl2[0])` so while the outer container has been copied, the contained objects are references to the same thing.\r\n\r\nOne of the conditions is this (assigning `self._list` in `makeGangaListByRef()`): An object is being assigned to a schema item which is not marked as a `sequence` but the item is a `ComponentItem` and the object we're passing in is a list-type thing (in this case an actual Python `list`). The code will make a deepcopy-type `cloneVal()` of the object, converting any list-type things to `GangaList`s. This has the effect of deepcopying all the objects so that none of the `id`s match anymore.\r\n\r\nCan anyone thing of a solid reason why we would want to be doing a recursive deepcopy of a list object when assigning it to a `GangaObject`? Or should I fix the code so that it's back to 6.1.12 when all the tests passed?"}}