{"action":"opened","issue":{"url":"https://api.github.com/repos/pybind/pybind11/issues/176","repository_url":"https://api.github.com/repos/pybind/pybind11","labels_url":"https://api.github.com/repos/pybind/pybind11/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/pybind/pybind11/issues/176/comments","events_url":"https://api.github.com/repos/pybind/pybind11/issues/176/events","html_url":"https://github.com/pybind/pybind11/issues/176","id":150461057,"number":176,"title":"Request for new return value policy","user":{"login":"pschella","id":211955,"avatar_url":"https://avatars.githubusercontent.com/u/211955?v=3","gravatar_id":"","url":"https://api.github.com/users/pschella","html_url":"https://github.com/pschella","followers_url":"https://api.github.com/users/pschella/followers","following_url":"https://api.github.com/users/pschella/following{/other_user}","gists_url":"https://api.github.com/users/pschella/gists{/gist_id}","starred_url":"https://api.github.com/users/pschella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pschella/subscriptions","organizations_url":"https://api.github.com/users/pschella/orgs","repos_url":"https://api.github.com/users/pschella/repos","events_url":"https://api.github.com/users/pschella/events{/privacy}","received_events_url":"https://api.github.com/users/pschella/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-22T20:12:00Z","updated_at":"2016-04-22T20:12:00Z","closed_at":null,"body":"The ``return_value_policy::reference_internal`` does two things:\r\n\r\n- it says that the new object is not \"owned\", so it should not be deleted when its Python reference count goes to zero;\r\n- it increments the Python reference count of the parent, so it will not be deleted while there are children.\r\n\r\nThere are however situations where you want only the latter to happen.\r\nCase in point, a container returning an iterator object. The container should be kept alive as long as there are iterators around, but the container should not be responsible for keeping track of, and ultimately destroying, all its iterators.\r\n\r\nI would like to request a new return value policy which only does the latter."}}