GitHub PullRequestReviewCommentEvent at 2014-01-03 08:43:48
Repository: rq
Actor: nvie
Payload: {"comment":{"url":"https://api.github.com/repos/nvie/rq/pulls/comments/8630756","id":8630756,"diff_hunk":"@@ -63,9 +64,28 @@ def get_current_job():\n     return Job.fetch(job_id)\n \n \n+def lazy(f):\n+    \"\"\"Decorator for a lazy data property.\"\"\"\n+\n+    attr = \"_\" + f.__name__\n+\n+    @wraps(f)\n+    def decorator(job):\n+        if job.data is not None:\n+            job._func_name, job._instance, job._args, job._kwargs = unpickle(job.data)\n+            del job.data\n+\n+        return getattr(job, attr)\n+\n+    return property(decorator)\n+\n+","path":"rq/job.py","position":27,"original_position":27,"commit_id":"56ad59eabc70f4f587f87a62e06604549b2e6379","original_commit_id":"56ad59eabc70f4f587f87a62e06604549b2e6379","user":{"login":"nvie","id":83844,"avatar_url":"https://gravatar.com/avatar/466ef7561a0b100dc5a1021959962d28?d=https%3A%2F%2Fidenticons.github.com%2Fe6d0513ce49cc06cb956251623cb8fd9.png&r=x","gravatar_id":"466ef7561a0b100dc5a1021959962d28","url":"https://api.github.com/users/nvie","html_url":"https://github.com/nvie","followers_url":"https://api.github.com/users/nvie/followers","following_url":"https://api.github.com/users/nvie/following{/other_user}","gists_url":"https://api.github.com/users/nvie/gists{/gist_id}","starred_url":"https://api.github.com/users/nvie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvie/subscriptions","organizations_url":"https://api.github.com/users/nvie/orgs","repos_url":"https://api.github.com/users/nvie/repos","events_url":"https://api.github.com/users/nvie/events{/privacy}","received_events_url":"https://api.github.com/users/nvie/received_events","type":"User","site_admin":false},"body":"This decorator is named very general purpose-y, yet is pretty specificly tailored to the case at hand. We should either rename it, or not use a decorator in the first place (I will comment on that in a minute).","created_at":"2014-01-03T08:43:48Z","updated_at":"2014-01-03T08:43:48Z","html_url":"https://github.com/nvie/rq/pull/295#discussion_r8630756","pull_request_url":"https://api.github.com/repos/nvie/rq/pulls/295","_links":{"self":{"href":"https://api.github.com/repos/nvie/rq/pulls/comments/8630756"},"html":{"href":"https://github.com/nvie/rq/pull/295#discussion_r8630756"},"pull_request":{"href":"https://api.github.com/repos/nvie/rq/pulls/295"}}}}