{"action":"created","issue":{"url":"https://api.github.com/repos/micropython/micropython/issues/2720","repository_url":"https://api.github.com/repos/micropython/micropython","labels_url":"https://api.github.com/repos/micropython/micropython/issues/2720/labels{/name}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/2720/comments","events_url":"https://api.github.com/repos/micropython/micropython/issues/2720/events","html_url":"https://github.com/micropython/micropython/issues/2720","id":197485883,"number":2720,"title":"Can't get property value of the superclass","user":{"login":"nupha","id":22436228,"avatar_url":"https://avatars.githubusercontent.com/u/22436228?v=3","gravatar_id":"","url":"https://api.github.com/users/nupha","html_url":"https://github.com/nupha","followers_url":"https://api.github.com/users/nupha/followers","following_url":"https://api.github.com/users/nupha/following{/other_user}","gists_url":"https://api.github.com/users/nupha/gists{/gist_id}","starred_url":"https://api.github.com/users/nupha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nupha/subscriptions","organizations_url":"https://api.github.com/users/nupha/orgs","repos_url":"https://api.github.com/users/nupha/repos","events_url":"https://api.github.com/users/nupha/events{/privacy}","received_events_url":"https://api.github.com/users/nupha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-25T03:28:02Z","updated_at":"2016-12-25T08:29:12Z","closed_at":null,"body":"As following code shows, a subclass to override property 'p' of superclass. Calling super().p in subclass will return a property object, not the value. Further more, this property object has no .fget attribute as suggested in standard python. But a 'getter' method is found on property object, when I call .getter(o), another property object returned, still not value. \r\n\r\nSo, I can't get the property value of superclass. Any suggestion?\r\n\r\nclass A:\r\n    @property\r\n    def p(self):\r\n        return {\"a\":10}\r\n\r\nclass AA(A):\r\n    @property\r\n    def p(self):\r\n        # get super property, add some new value\r\n        v = super().p\r\n        v['aa'] = 20    # this will raise an exception, because v is a property object, not a dict\r\n        return v"},"comment":{"url":"https://api.github.com/repos/micropython/micropython/issues/comments/269114262","html_url":"https://github.com/micropython/micropython/issues/2720#issuecomment-269114262","issue_url":"https://api.github.com/repos/micropython/micropython/issues/2720","id":269114262,"user":{"login":"peterhinch","id":8437477,"avatar_url":"https://avatars.githubusercontent.com/u/8437477?v=3","gravatar_id":"","url":"https://api.github.com/users/peterhinch","html_url":"https://github.com/peterhinch","followers_url":"https://api.github.com/users/peterhinch/followers","following_url":"https://api.github.com/users/peterhinch/following{/other_user}","gists_url":"https://api.github.com/users/peterhinch/gists{/gist_id}","starred_url":"https://api.github.com/users/peterhinch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterhinch/subscriptions","organizations_url":"https://api.github.com/users/peterhinch/orgs","repos_url":"https://api.github.com/users/peterhinch/repos","events_url":"https://api.github.com/users/peterhinch/events{/privacy}","received_events_url":"https://api.github.com/users/peterhinch/received_events","type":"User","site_admin":false},"created_at":"2016-12-25T08:29:12Z","updated_at":"2016-12-25T08:29:12Z","body":"This can be simplified to\r\n```python\r\nclass A:\r\n    @property\r\n    def p(self):\r\n        return {\"a\":10}\r\n\r\nclass AA(A):\r\n    @property\r\n    def p(self):\r\n        return super().p\r\n```\r\nUnder CPython 3.5.2:\r\n```\r\n>>> a = AA()\r\n>>> a.p\r\n{'a': 10}\r\n>>> \r\n```\r\nUnder MicroPython (Unix build)\r\n```\r\n>>> a = AA()\r\n>>> a.p\r\n<property>\r\n>>> \r\n```\r\nI can't see a reference to this in the [differences from CPython doc](https://github.com/micropython/micropython/wiki/Differences).\r\n"}}
{"actor":{"display_login":"peterhinch"}}