{"action":"created","issue":{"url":"https://api.github.com/repos/pybind/pybind11/issues/265","repository_url":"https://api.github.com/repos/pybind/pybind11","labels_url":"https://api.github.com/repos/pybind/pybind11/issues/265/labels{/name}","comments_url":"https://api.github.com/repos/pybind/pybind11/issues/265/comments","events_url":"https://api.github.com/repos/pybind/pybind11/issues/265/events","html_url":"https://github.com/pybind/pybind11/issues/265","id":163579979,"number":265,"title":"Add attr() method to detail::accessor?","user":{"login":"aldanor","id":2418513,"avatar_url":"https://avatars.githubusercontent.com/u/2418513?v=3","gravatar_id":"","url":"https://api.github.com/users/aldanor","html_url":"https://github.com/aldanor","followers_url":"https://api.github.com/users/aldanor/followers","following_url":"https://api.github.com/users/aldanor/following{/other_user}","gists_url":"https://api.github.com/users/aldanor/gists{/gist_id}","starred_url":"https://api.github.com/users/aldanor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldanor/subscriptions","organizations_url":"https://api.github.com/users/aldanor/orgs","repos_url":"https://api.github.com/users/aldanor/repos","events_url":"https://api.github.com/users/aldanor/events{/privacy}","received_events_url":"https://api.github.com/users/aldanor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-07-03T21:09:24Z","updated_at":"2016-08-01T21:47:46Z","closed_at":null,"body":"This is a minor thing, but it would sure be nice to be able to do\r\n\r\n```cpp\r\nfoo.attr(\"x\").attr(\"y\").attr(\"z\")\r\n```\r\n\r\nwithout having to do all the unnecessary temporary casting. Or maybe allow `foo.attr(\"x\", \"y\", \"z\")` although that's a less obvious syntax."},"comment":{"url":"https://api.github.com/repos/pybind/pybind11/issues/comments/236718376","html_url":"https://github.com/pybind/pybind11/issues/265#issuecomment-236718376","issue_url":"https://api.github.com/repos/pybind/pybind11/issues/265","id":236718376,"user":{"login":"wjakob","id":1203629,"avatar_url":"https://avatars.githubusercontent.com/u/1203629?v=3","gravatar_id":"","url":"https://api.github.com/users/wjakob","html_url":"https://github.com/wjakob","followers_url":"https://api.github.com/users/wjakob/followers","following_url":"https://api.github.com/users/wjakob/following{/other_user}","gists_url":"https://api.github.com/users/wjakob/gists{/gist_id}","starred_url":"https://api.github.com/users/wjakob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjakob/subscriptions","organizations_url":"https://api.github.com/users/wjakob/orgs","repos_url":"https://api.github.com/users/wjakob/repos","events_url":"https://api.github.com/users/wjakob/events{/privacy}","received_events_url":"https://api.github.com/users/wjakob/received_events","type":"User","site_admin":false},"created_at":"2016-08-01T21:47:46Z","updated_at":"2016-08-01T21:47:46Z","body":"I'll try to chime a bit :)\r\n\r\nI'm hesitant against changing the API to ``attr/setattr``, which will break many projects using this library. Another reason against this approach is that all of this doesn't just apply to ``attr()`` but also ``operator[]``, and there is no renaming trick that would work in this case.\r\n\r\nSubclassing from object and immediately doing a ``GetAttr()`` is IMHO also a no-go. Since these basic functions are used throughout the library internals, any change here will lead to considerable bloat in the generated binaries. It's suprising how easy it is to add hundreds of KBs to the example project just by adding a function call into a hot template function.\r\n\r\nThat seems to leave just one option, which is what @aldanor suggested initially: make the ``detail::accessor`` interface more complete.\r\n\r\nOff-topic: adding ``contains`` seems fine to me."}}
{"actor":{"display_login":"wjakob"}}