{"action":"created","issue":{"url":"https://api.github.com/repos/ericrasmussen/pyramid_redis_sessions/issues/75","repository_url":"https://api.github.com/repos/ericrasmussen/pyramid_redis_sessions","labels_url":"https://api.github.com/repos/ericrasmussen/pyramid_redis_sessions/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/ericrasmussen/pyramid_redis_sessions/issues/75/comments","events_url":"https://api.github.com/repos/ericrasmussen/pyramid_redis_sessions/issues/75/events","html_url":"https://github.com/ericrasmussen/pyramid_redis_sessions/issues/75","id":191355088,"number":75,"title":"Possible bug: constructor overwriting reify method","user":{"login":"robvdl","id":1018674,"avatar_url":"https://avatars.githubusercontent.com/u/1018674?v=3","gravatar_id":"","url":"https://api.github.com/users/robvdl","html_url":"https://github.com/robvdl","followers_url":"https://api.github.com/users/robvdl/followers","following_url":"https://api.github.com/users/robvdl/following{/other_user}","gists_url":"https://api.github.com/users/robvdl/gists{/gist_id}","starred_url":"https://api.github.com/users/robvdl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robvdl/subscriptions","organizations_url":"https://api.github.com/users/robvdl/orgs","repos_url":"https://api.github.com/users/robvdl/repos","events_url":"https://api.github.com/users/robvdl/events{/privacy}","received_events_url":"https://api.github.com/users/robvdl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-23T18:57:55Z","updated_at":"2016-12-10T00:12:12Z","closed_at":null,"body":"in session.py, line 84 in the constructor says:\r\n\r\nself._session_state = self._make_session_state(....\r\n\r\nHowever on line 90 of the same file, there already is a @reify method also called _session_state in the same class, so the way I am reading this, as soon as the constructor is run, that method is \"replaced\" with an instance variable.\r\n\r\nThis doesn't sound right."},"comment":{"url":"https://api.github.com/repos/ericrasmussen/pyramid_redis_sessions/issues/comments/266158378","html_url":"https://github.com/ericrasmussen/pyramid_redis_sessions/issues/75#issuecomment-266158378","issue_url":"https://api.github.com/repos/ericrasmussen/pyramid_redis_sessions/issues/75","id":266158378,"user":{"login":"whiteroses","id":291075,"avatar_url":"https://avatars.githubusercontent.com/u/291075?v=3","gravatar_id":"","url":"https://api.github.com/users/whiteroses","html_url":"https://github.com/whiteroses","followers_url":"https://api.github.com/users/whiteroses/followers","following_url":"https://api.github.com/users/whiteroses/following{/other_user}","gists_url":"https://api.github.com/users/whiteroses/gists{/gist_id}","starred_url":"https://api.github.com/users/whiteroses/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whiteroses/subscriptions","organizations_url":"https://api.github.com/users/whiteroses/orgs","repos_url":"https://api.github.com/users/whiteroses/repos","events_url":"https://api.github.com/users/whiteroses/events{/privacy}","received_events_url":"https://api.github.com/users/whiteroses/received_events","type":"User","site_admin":false},"created_at":"2016-12-10T00:12:12Z","updated_at":"2016-12-10T00:12:12Z","body":"Hi @robvdl, I believe I wrote this code. `__init__` doesn't replace the `_session_state` method so much as cover it temporarily with the session state we just created (so that any access to `_session_state`, we get the `__init__`-created instance variable, as you say).\r\n\r\nWhen  `invalidate()` deletes `_session_state` in line 152, it reveals the reify-decorated method underneath, ready to create a new `_session_state` next time it is accessed. This relies on how Pyramid's `reify` works.\r\n\r\nProbably should've added a comment in `__init__` to clarify this &mdash; will submit a pull request when I have a bit more time."}}
{"actor":{"display_login":"whiteroses"}}