{"action":"created","issue":{"url":"https://api.github.com/repos/zopefoundation/persistent/issues/20","labels_url":"https://api.github.com/repos/zopefoundation/persistent/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/zopefoundation/persistent/issues/20/comments","events_url":"https://api.github.com/repos/zopefoundation/persistent/issues/20/events","html_url":"https://github.com/zopefoundation/persistent/pull/20","id":67253847,"number":20,"title":"Support for ZODB on PyPy","user":{"login":"jamadden","id":1256082,"avatar_url":"https://avatars.githubusercontent.com/u/1256082?v=3","gravatar_id":"","url":"https://api.github.com/users/jamadden","html_url":"https://github.com/jamadden","followers_url":"https://api.github.com/users/jamadden/followers","following_url":"https://api.github.com/users/jamadden/following{/other_user}","gists_url":"https://api.github.com/users/jamadden/gists{/gist_id}","starred_url":"https://api.github.com/users/jamadden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamadden/subscriptions","organizations_url":"https://api.github.com/users/jamadden/orgs","repos_url":"https://api.github.com/users/jamadden/repos","events_url":"https://api.github.com/users/jamadden/events{/privacy}","received_events_url":"https://api.github.com/users/jamadden/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":24,"created_at":"2015-04-09T00:58:26Z","updated_at":"2015-05-19T22:00:35Z","closed_at":"2015-05-19T21:55:16Z","pull_request":{"url":"https://api.github.com/repos/zopefoundation/persistent/pulls/20","html_url":"https://github.com/zopefoundation/persistent/pull/20","diff_url":"https://github.com/zopefoundation/persistent/pull/20.diff","patch_url":"https://github.com/zopefoundation/persistent/pull/20.patch"},"body":"This PR brings the necessary changes to make the complete set of ZODB unit and functional tests pass (1410 in total). (See zopefoundation/ZODB#33)\r\n\r\nMostly this consisted of making the Python implementation more closely mirror the C implementation. A few notable things:\r\n\r\n- The PickleCache now supports the byte-size limit and the `total_estimated_size`.\r\n- The PickleCache now ghostifies objects during a GC, and handles objects that either deliberately or accidentally override `_p_invalidate` and `_p_activate` without calling super (ZODB's Blob is an example of a deliberate use of both).\r\n- The Persistent class now calls the same methods in the same order as the C class; code in the wild could easily depend on this accidentally. It's also safe to use many of the `_p` attributes in more circumstances than before (ZODB's Broken class relies on this).\r\n- A few restrictions had to be relaxed to match the C implementation (e.g., allowing arbitrary values for `_p_oid`, something that could easily crop up in test code in the wild like it did in ZODB) ; a few restrictions had to be added to match the C implementation (e.g., requiring objects in the PickleCache to have a jar).\r\n\r\nAll of the existing test cases should pass with very minor changes. I've already added a few test cases for the easier things and will see about adding a few more if I can extract them from ZODB in a reasonable form to try to get the coverage a bit higher (although it's not too bad as it is). Some of the scenarios are fairly complex though so it may be difficult to separate them. (Although, especially in the case of the C implementations it seems like many of the test cases still effectively live in ZODB.)\r\n\r\nI'm opening this PR a bit early because I know it's large and involves some changes in the way the cache and Persistent objects have to interact, so I'm open to any feedback and suggestions. Plus I probably can't open a PR for the ZODB changes until this gets merged and released :)\r\n\r\n```\r\nName                     Stmts   Miss Branch BrMiss  Cover   Missing\r\n--------------------------------------------------------------------\r\npersistent                  21     11      0      0    48%   24-46\r\npersistent._compat           1      0      0      0   100%\r\npersistent.dict              1      0      0      0   100%\r\npersistent.interfaces        9      3      0      0    67%   23-25\r\npersistent.list             60      0      0      0   100%\r\npersistent.mapping          44      0      4      0   100%\r\npersistent.persistence     297      0    150      0   100%\r\npersistent.picklecache     223     15    106     12    92%   65-67, 100, 118, 124, 165, 295-305, 399-401\r\npersistent.timestamp       125      0     14      0   100%\r\npersistent.timestamp       125      0     14      0   100%\r\npersistent.wref             68      0     18      0   100%\r\n--------------------------------------------------------------------\r\nTOTAL                      972     31    308     14    96%\r\n```"},"comment":{"url":"https://api.github.com/repos/zopefoundation/persistent/issues/comments/103680105","html_url":"https://github.com/zopefoundation/persistent/pull/20#issuecomment-103680105","issue_url":"https://api.github.com/repos/zopefoundation/persistent/issues/20","id":103680105,"user":{"login":"tseaver","id":242750,"avatar_url":"https://avatars.githubusercontent.com/u/242750?v=3","gravatar_id":"","url":"https://api.github.com/users/tseaver","html_url":"https://github.com/tseaver","followers_url":"https://api.github.com/users/tseaver/followers","following_url":"https://api.github.com/users/tseaver/following{/other_user}","gists_url":"https://api.github.com/users/tseaver/gists{/gist_id}","starred_url":"https://api.github.com/users/tseaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tseaver/subscriptions","organizations_url":"https://api.github.com/users/tseaver/orgs","repos_url":"https://api.github.com/users/tseaver/repos","events_url":"https://api.github.com/users/tseaver/events{/privacy}","received_events_url":"https://api.github.com/users/tseaver/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T22:00:35Z","updated_at":"2015-05-19T22:00:35Z","body":"Pushed via https://pypi.python.org/pypi/persistent/4.1.0"}}