{"action":"closed","issue":{"url":"https://api.github.com/repos/brython-dev/brython/issues/108","labels_url":"https://api.github.com/repos/brython-dev/brython/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/brython-dev/brython/issues/108/comments","events_url":"https://api.github.com/repos/brython-dev/brython/issues/108/events","html_url":"https://github.com/brython-dev/brython/issues/108","id":54786038,"number":108,"title":"updating __dict__ of object does not work.","user":{"login":"earney","id":1158898,"avatar_url":"https://avatars.githubusercontent.com/u/1158898?v=3","gravatar_id":"","url":"https://api.github.com/users/earney","html_url":"https://github.com/earney","followers_url":"https://api.github.com/users/earney/followers","following_url":"https://api.github.com/users/earney/following{/other_user}","gists_url":"https://api.github.com/users/earney/gists{/gist_id}","starred_url":"https://api.github.com/users/earney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/earney/subscriptions","organizations_url":"https://api.github.com/users/earney/orgs","repos_url":"https://api.github.com/users/earney/repos","events_url":"https://api.github.com/users/earney/events{/privacy}","received_events_url":"https://api.github.com/users/earney/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-01-19T16:44:08Z","updated_at":"2015-01-24T16:24:55Z","closed_at":"2015-01-24T16:24:55Z","body":"The following code does not work in brython (but does work in python 3.x).  Most objects in python have a \\__dict\\__ variable that can be updated to add/update variables.     Should we think about creating a \\__dict\\__ variable for each new class/function or should we use some other approach to emulate this?\r\n```\r\ndef funcattrs(**kwds):\r\n    def decorate(func):\r\n        func.\\__dict\\__.update(kwds)\r\n        return func\r\n    return decorate\r\n\r\nclass C(object):\r\n       @funcattrs(abc=1, xyz=\"haha\")\r\n       @funcattrs(booh=42)\r\n       def foo(self): return 42\r\n\r\nprint(C().foo(), 42)\r\nprint(C.foo.abc, 1)\r\nprint(C.foo.xyz, \"haha\")\r\nprint(C.foo.booh, 42)\r\n```"}}