{"action":"created","issue":{"url":"https://api.github.com/repos/googleapis/google-cloud-python/issues/6258","repository_url":"https://api.github.com/repos/googleapis/google-cloud-python","labels_url":"https://api.github.com/repos/googleapis/google-cloud-python/issues/6258/labels{/name}","comments_url":"https://api.github.com/repos/googleapis/google-cloud-python/issues/6258/comments","events_url":"https://api.github.com/repos/googleapis/google-cloud-python/issues/6258/events","html_url":"https://github.com/googleapis/google-cloud-python/pull/6258","id":371306296,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzNzg0MjA1","number":6258,"title":"Restoring some `__new__()` constructors for `ndb`.","user":{"login":"dhermes","id":520669,"node_id":"MDQ6VXNlcjUyMDY2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/520669?v=4","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"labels":[{"id":1094971474,"node_id":"MDU6TGFiZWwxMDk0OTcxNDc0","url":"https://api.github.com/repos/googleapis/google-cloud-python/labels/api:%20ndb","name":"api: ndb","color":"f8f8f8","default":false},{"id":131682747,"node_id":"MDU6TGFiZWwxMzE2ODI3NDc=","url":"https://api.github.com/repos/googleapis/google-cloud-python/labels/cla:%20yes","name":"cla: yes","color":"0B7601","default":false},{"id":744431643,"node_id":"MDU6TGFiZWw3NDQ0MzE2NDM=","url":"https://api.github.com/repos/googleapis/google-cloud-python/labels/type:%20cleanup","name":"type: cleanup","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-17T23:34:51Z","updated_at":"2018-10-18T15:31:32Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/googleapis/google-cloud-python/pulls/6258","html_url":"https://github.com/googleapis/google-cloud-python/pull/6258","diff_url":"https://github.com/googleapis/google-cloud-python/pull/6258.diff","patch_url":"https://github.com/googleapis/google-cloud-python/pull/6258.patch"},"body":"See the comment in `MIGRATION_NOTES.md` about the rampant use (and abuse) of `__new__()` rather than `__init__()` as a constructor.\r\n\r\nUpdated `MIGRATION_NOTES.md` to make a note about the difference in internal state between old and new versions of `ndb`. In particular, the new version has dropped usage of \"private\" (e.g. `self.__foo`) variables.\r\n\r\nRemoved `__slots__` from classes that didn't have them in the old implementation.\r\n\r\n----\r\n\r\n@theacodes and I discussed this and the conclusion was that \"the old way\" should be preserved as often as possible"},"comment":{"url":"https://api.github.com/repos/googleapis/google-cloud-python/issues/comments/431055048","html_url":"https://github.com/googleapis/google-cloud-python/pull/6258#issuecomment-431055048","issue_url":"https://api.github.com/repos/googleapis/google-cloud-python/issues/6258","id":431055048,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTA1NTA0OA==","user":{"login":"dhermes","id":520669,"node_id":"MDQ6VXNlcjUyMDY2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/520669?v=4","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"created_at":"2018-10-18T15:31:32Z","updated_at":"2018-10-18T15:31:32Z","author_association":"CONTRIBUTOR","body":"@tseaver I was just trying to be \"compatible\" with the [old implementation][1], which has lots of warts.\r\n\r\nI actually think it's the \"right\" idea to use `__slots__` on essentially every class since I'm remapping the \"private\" variables (e.g. `self.__foo` becomes `self._foo`).\r\n\r\n@theacodes Where does this fall on our discussion about preserving the old behavior? (The original discussion was just that I should use `__new__` whenever the original impl. did.)\r\n\r\n[1]: https://github.com/GoogleCloudPlatform/datastore-ndb-python"}}
{"actor":{"display_login":"dhermes"}}