{"action":"created","issue":{"url":"https://api.github.com/repos/hynek/attrs/issues/96","repository_url":"https://api.github.com/repos/hynek/attrs","labels_url":"https://api.github.com/repos/hynek/attrs/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/hynek/attrs/issues/96/comments","events_url":"https://api.github.com/repos/hynek/attrs/issues/96/events","html_url":"https://github.com/hynek/attrs/pull/96","id":178217727,"number":96,"title":"Introduce attribute metadata.","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-09-21T00:50:50Z","updated_at":"2016-09-28T05:17:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hynek/attrs/pulls/96","html_url":"https://github.com/hynek/attrs/pull/96","diff_url":"https://github.com/hynek/attrs/pull/96.diff","patch_url":"https://github.com/hynek/attrs/pull/96.patch"},"body":"Alright, here's a first pass, open for comments. Docs will come after the implementation is settled.\r\n\r\nThe syntax is:\r\n```\r\n@attr.s\r\nclass A:\r\n    a = attr.ib(metadata=<metadata>)\r\n```\r\nwhere `<metadata>` can be:\r\n* None\r\n* a mapping (technically something that can be passed to the dict constructor)\r\n\r\nOn Python 2, the metadata (if not None) will be exposed as a plain dict. On Python 3, the original, passed-in mapping will be wrapped in a https://docs.python.org/3.5/library/types.html#types.MappingProxyType.\r\n\r\nI'm not entirely happy with None as the default here (it's my pet peeve to have Optional[Collection] instead of just an empty collection) but I feel an empty dict per attribute might be too much memory overhead? MappingProxyType would have solved this elegantly (we would have one empty instance, used everywhere where there was no metadata), but alas.\r\n\r\nI've tried marking the metadata field as excluded from hashing but I don't think we care much about that. I put together a property test for this but it kept failing since the `default` field isn't excluded, and the default was getting set to `{}`. Guess we don't care about it too much? Doubt many people will make sets of Attributes.\r\n\r\nAs a bonus I've made _CountingAttr slotted. There's no reason it shouldn't be."},"comment":{"url":"https://api.github.com/repos/hynek/attrs/issues/comments/250073923","html_url":"https://github.com/hynek/attrs/pull/96#issuecomment-250073923","issue_url":"https://api.github.com/repos/hynek/attrs/issues/96","id":250073923,"user":{"login":"hynek","id":41240,"avatar_url":"https://avatars.githubusercontent.com/u/41240?v=3","gravatar_id":"","url":"https://api.github.com/users/hynek","html_url":"https://github.com/hynek","followers_url":"https://api.github.com/users/hynek/followers","following_url":"https://api.github.com/users/hynek/following{/other_user}","gists_url":"https://api.github.com/users/hynek/gists{/gist_id}","starred_url":"https://api.github.com/users/hynek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hynek/subscriptions","organizations_url":"https://api.github.com/users/hynek/orgs","repos_url":"https://api.github.com/users/hynek/repos","events_url":"https://api.github.com/users/hynek/events{/privacy}","received_events_url":"https://api.github.com/users/hynek/received_events","type":"User","site_admin":false},"created_at":"2016-09-28T05:17:34Z","updated_at":"2016-09-28T05:17:34Z","body":"I guess what glyph is saying: @tinche pls finalize.  :)"}}
{"actor":{"display_login":"hynek"}}