{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/657","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/657/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/657/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/657/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/657","id":57889896,"number":657,"title":"Lazy load defaults","user":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","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":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/labels/cla:%20yes","name":"cla: yes","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-17T06:47:17Z","updated_at":"2015-02-17T18:18:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/657","html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/657","diff_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/657.diff","patch_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/657.patch"},"body":"@tseaver This can be split into 3 distinct PRs if you like:\r\n\r\n- Use an `Environment` class and an instance in `_implicit_environ` (attrs of instance replace class \"constants\")\r\n- Moving the code for `set_default_dataset_id` from `__init__` to `_implicit_environ`\r\n- Add a lazy loading descriptor for setting the default dataset ID on the default instance from `_implicit_environ`\r\n\r\nStill missing: a lazy loading descriptor for `connection` (it's pretty tangled in to the tests, so I wanted to discuss this before putting in too much work on that)\r\n\r\n**UPDATE**: I think the best strategy for testing might be to just replace `_implicit_environ.DEFAULT_ENVIRON` with a fake instance that has `None`s explicitly set in place of the lazily loaded pieces"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/comments/74720460","html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/657#issuecomment-74720460","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/657","id":74720460,"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-02-17T18:18:58Z","updated_at":"2015-02-17T18:18:58Z","body":"LGTM"}}