{"action":"created","issue":{"url":"https://api.github.com/repos/hynek/attrs/issues/77","repository_url":"https://api.github.com/repos/hynek/attrs","labels_url":"https://api.github.com/repos/hynek/attrs/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/hynek/attrs/issues/77/comments","events_url":"https://api.github.com/repos/hynek/attrs/issues/77/events","html_url":"https://github.com/hynek/attrs/issues/77","id":175117259,"number":77,"title":"astuple method","user":{"login":"Insoleet","id":1170293,"avatar_url":"https://avatars.githubusercontent.com/u/1170293?v=3","gravatar_id":"","url":"https://api.github.com/users/Insoleet","html_url":"https://github.com/Insoleet","followers_url":"https://api.github.com/users/Insoleet/followers","following_url":"https://api.github.com/users/Insoleet/following{/other_user}","gists_url":"https://api.github.com/users/Insoleet/gists{/gist_id}","starred_url":"https://api.github.com/users/Insoleet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Insoleet/subscriptions","organizations_url":"https://api.github.com/users/Insoleet/orgs","repos_url":"https://api.github.com/users/Insoleet/repos","events_url":"https://api.github.com/users/Insoleet/events{/privacy}","received_events_url":"https://api.github.com/users/Insoleet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hynek/attrs/labels/Feature","name":"Feature","color":"0e8a16"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-05T19:00:07Z","updated_at":"2016-09-06T09:36:01Z","closed_at":null,"body":"Hello,\r\n\r\nFor the usage of attr with DB API 2.0 libraries (like Sqlite3), it would be great to have a `astuple` method.\r\n\r\nThis method would return the object values in a tuple, ordered by the order of declaration of it's attributes.\r\n\r\nFor example we could do things like this : \r\n\r\n```python\r\nimport sqlite3\r\nimport attr\r\n\r\n@attr.s()\r\nclass Foo:\r\n    a = attr.ib()\r\n    b = attr.ib()\r\n\r\nfoo = Foo(2, 3)\r\ncon = sqlite3.connect(\":memory:\")\r\nwith con:\r\n    con.execute(\"INSERT INTO foo VALUES (?, ?)\", attr.astuple(foo))\r\n```\r\n\r\nThis would be useful for DB API libraries but also for other needs probably.\r\n\r\nWhat is your opinion about it ?\r\n"},"comment":{"url":"https://api.github.com/repos/hynek/attrs/issues/comments/244899969","html_url":"https://github.com/hynek/attrs/issues/77#issuecomment-244899969","issue_url":"https://api.github.com/repos/hynek/attrs/issues/77","id":244899969,"user":{"login":"Tinche","id":1909233,"avatar_url":"https://avatars.githubusercontent.com/u/1909233?v=3","gravatar_id":"","url":"https://api.github.com/users/Tinche","html_url":"https://github.com/Tinche","followers_url":"https://api.github.com/users/Tinche/followers","following_url":"https://api.github.com/users/Tinche/following{/other_user}","gists_url":"https://api.github.com/users/Tinche/gists{/gist_id}","starred_url":"https://api.github.com/users/Tinche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tinche/subscriptions","organizations_url":"https://api.github.com/users/Tinche/orgs","repos_url":"https://api.github.com/users/Tinche/repos","events_url":"https://api.github.com/users/Tinche/events{/privacy}","received_events_url":"https://api.github.com/users/Tinche/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T09:36:01Z","updated_at":"2016-09-06T09:36:01Z","body":"I think this would be a nice mirror to asdict. Also a tuple of values will be more efficient than a dict if you can use this.\r\n\r\n@Insoleet Would you like to implement this? It's relatively easy and more contributors is always good :) I can do a preliminary review before @hynek."}}
{"actor":{"display_login":"Tinche"}}