{"action":"created","issue":{"url":"https://api.github.com/repos/ericvsmith/dataclasses/issues/38","repository_url":"https://api.github.com/repos/ericvsmith/dataclasses","labels_url":"https://api.github.com/repos/ericvsmith/dataclasses/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/ericvsmith/dataclasses/issues/38/comments","events_url":"https://api.github.com/repos/ericvsmith/dataclasses/issues/38/events","html_url":"https://github.com/ericvsmith/dataclasses/issues/38","id":256385573,"number":38,"title":"Test needed: Check items in class and instance dicts","user":{"login":"ericvsmith","id":489791,"avatar_url":"https://avatars0.githubusercontent.com/u/489791?v=4","gravatar_id":"","url":"https://api.github.com/users/ericvsmith","html_url":"https://github.com/ericvsmith","followers_url":"https://api.github.com/users/ericvsmith/followers","following_url":"https://api.github.com/users/ericvsmith/following{/other_user}","gists_url":"https://api.github.com/users/ericvsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/ericvsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericvsmith/subscriptions","organizations_url":"https://api.github.com/users/ericvsmith/orgs","repos_url":"https://api.github.com/users/ericvsmith/repos","events_url":"https://api.github.com/users/ericvsmith/events{/privacy}","received_events_url":"https://api.github.com/users/ericvsmith/received_events","type":"User","site_admin":false},"labels":[{"id":687418306,"url":"https://api.github.com/repos/ericvsmith/dataclasses/labels/needs%20test","name":"needs test","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-08T22:20:25Z","updated_at":"2017-09-12T09:26:19Z","closed_at":"2017-09-12T09:26:19Z","author_association":"OWNER","body":"I want to make sure that the instance dict is being initialized when I think it should be.\r\n\r\nIn:\r\n```\r\n@dataclass\r\nclass C:\r\n    a: int\r\n    b: list = field(default_factory=list, init=False)\r\n    c: list = field(default_factory=list)\r\n    d: int = field(default=4, init=False)\r\n    e: int = 0\r\n\r\nc=C(0)\r\n```\r\n\r\nThen:\r\n- only a, b, c, and e should be in the instance dict\r\n- d should be in the class dict with value 4\r\n- e should be in the class dict with value 0\r\n\r\nThe reasoning is:\r\n- a is in the instance dict because it's assigned to in `__init__`.\r\n- b is in the instance dict, even though it's not in the `__init__` param list. This is because the default factory still needs to be called from `__init__`.\r\n- c is in the instance dict because it's assigned to in `__init__`.\r\n- d is not in the instance dict because it's not assigned to by `__init__`. It's in the class dict because it has a default value.\r\n- e is in the instance dict because it's assigned to in `__init__`.\r\n\r\nThe generated `__init__` looks like:\r\n```\r\ndef __init__(self,a:_type_a,c:_type_c=_MISSING,e:_type_e=_dflt_e)->_return_type:\r\n    self.a = a\r\n    self.b = _dflt_b()\r\n    self.c = _dflt_c() if c is _MISSING else c\r\n    self.e = e\r\n\r\nlocals: {'_type_a': <class 'int'>, '_type_b': <class 'list'>, '_type_c': <class 'list'>, '_type_d': <class 'int'>, '_type_e': <class 'int'>, '_return_type': None}\r\nglobals: {'_MISSING': <object object at 0x10ea26100>, '_dflt_b': <class 'list'>, '_dflt_c': <class 'list'>, '_dflt_e': 0}\r\n```"},"comment":{"url":"https://api.github.com/repos/ericvsmith/dataclasses/issues/comments/328796381","html_url":"https://github.com/ericvsmith/dataclasses/issues/38#issuecomment-328796381","issue_url":"https://api.github.com/repos/ericvsmith/dataclasses/issues/38","id":328796381,"user":{"login":"ericvsmith","id":489791,"avatar_url":"https://avatars0.githubusercontent.com/u/489791?v=4","gravatar_id":"","url":"https://api.github.com/users/ericvsmith","html_url":"https://github.com/ericvsmith","followers_url":"https://api.github.com/users/ericvsmith/followers","following_url":"https://api.github.com/users/ericvsmith/following{/other_user}","gists_url":"https://api.github.com/users/ericvsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/ericvsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericvsmith/subscriptions","organizations_url":"https://api.github.com/users/ericvsmith/orgs","repos_url":"https://api.github.com/users/ericvsmith/repos","events_url":"https://api.github.com/users/ericvsmith/events{/privacy}","received_events_url":"https://api.github.com/users/ericvsmith/received_events","type":"User","site_admin":false},"created_at":"2017-09-12T09:26:19Z","updated_at":"2017-09-12T09:26:19Z","author_association":"OWNER","body":"Closed by #43."}}
{"actor":{"display_login":"ericvsmith"}}