{"action":"created","comment":{"url":"https://api.github.com/repos/csvoss/oneliner/pulls/comments/39226801","id":39226801,"diff_hunk":"@@ -389,11 +389,20 @@ def visit_FunctionDef(self, tree):\n                 T(',').join(ns.var(name) for name in arg_names),\n                 T(',').join(arg_names))\n         body = self.close(ns, body)\n-        function_code = decoration.format(args + body)\n-        return assignment_component(\n-            T('{after}'),\n-            T('{}, {}.__name__').format(self.store_var(tree.name), self.var(tree.name)),\n-            T('{}, {!r}').format(function_code, tree.name))\n+        function_code = args + body\n+        if tree.decorator_list:\n+            return assignment_component(\n+                T('{after}'),\n+                self.store_var(tree.name),\n+                decoration.format(assignment_component(\n+                    '__func',\n+                    '__func, __func.__name__',","path":"main.py","position":16,"original_position":16,"commit_id":"7bd0cdabec8659d6d5a26bf2cfb945367d7c8b21","original_commit_id":"7bd0cdabec8659d6d5a26bf2cfb945367d7c8b21","user":{"login":"andersk","id":26471,"avatar_url":"https://avatars.githubusercontent.com/u/26471?v=3","gravatar_id":"","url":"https://api.github.com/users/andersk","html_url":"https://github.com/andersk","followers_url":"https://api.github.com/users/andersk/followers","following_url":"https://api.github.com/users/andersk/following{/other_user}","gists_url":"https://api.github.com/users/andersk/gists{/gist_id}","starred_url":"https://api.github.com/users/andersk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersk/subscriptions","organizations_url":"https://api.github.com/users/andersk/orgs","repos_url":"https://api.github.com/users/andersk/repos","events_url":"https://api.github.com/users/andersk/events{/privacy}","received_events_url":"https://api.github.com/users/andersk/received_events","type":"User","site_admin":false},"body":"This sets the name on the pre-decorated function; it’s up to the decorators whether to propagate the name or not.","created_at":"2015-09-10T23:24:20Z","updated_at":"2015-09-10T23:24:20Z","html_url":"https://github.com/csvoss/oneliner/pull/44#discussion_r39226801","pull_request_url":"https://api.github.com/repos/csvoss/oneliner/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/csvoss/oneliner/pulls/comments/39226801"},"html":{"href":"https://github.com/csvoss/oneliner/pull/44#discussion_r39226801"},"pull_request":{"href":"https://api.github.com/repos/csvoss/oneliner/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/csvoss/oneliner/pulls/44","id":44583296,"html_url":"https://github.com/csvoss/oneliner/pull/44","diff_url":"https://github.com/csvoss/oneliner/pull/44.diff","patch_url":"https://github.com/csvoss/oneliner/pull/44.patch","issue_url":"https://api.github.com/repos/csvoss/oneliner/issues/44","number":44,"state":"closed","locked":false,"title":"Set function __name__ before applying decorators","user":{"login":"andersk","id":26471,"avatar_url":"https://avatars.githubusercontent.com/u/26471?v=3","gravatar_id":"","url":"https://api.github.com/users/andersk","html_url":"https://github.com/andersk","followers_url":"https://api.github.com/users/andersk/followers","following_url":"https://api.github.com/users/andersk/following{/other_user}","gists_url":"https://api.github.com/users/andersk/gists{/gist_id}","starred_url":"https://api.github.com/users/andersk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersk/subscriptions","organizations_url":"https://api.github.com/users/andersk/orgs","repos_url":"https://api.github.com/users/andersk/repos","events_url":"https://api.github.com/users/andersk/events{/privacy}","received_events_url":"https://api.github.com/users/andersk/received_events","type":"User","site_admin":false},"body":"Fixes #39.","created_at":"2015-09-09T18:23:01Z","updated_at":"2015-09-10T23:24:20Z","closed_at":"2015-09-10T23:21:35Z","merged_at":"2015-09-10T23:21:35Z","merge_commit_sha":"7bf3b15d5b240c1800f98731fd73c94118d35d48","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/csvoss/oneliner/pulls/44/commits","review_comments_url":"https://api.github.com/repos/csvoss/oneliner/pulls/44/comments","review_comment_url":"https://api.github.com/repos/csvoss/oneliner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/csvoss/oneliner/issues/44/comments","statuses_url":"https://api.github.com/repos/csvoss/oneliner/statuses/7bd0cdabec8659d6d5a26bf2cfb945367d7c8b21","head":{"label":"andersk:decorated-function-name","ref":"decorated-function-name","sha":"7bd0cdabec8659d6d5a26bf2cfb945367d7c8b21","user":{"login":"andersk","id":26471,"avatar_url":"https://avatars.githubusercontent.com/u/26471?v=3","gravatar_id":"","url":"https://api.github.com/users/andersk","html_url":"https://github.com/andersk","followers_url":"https://api.github.com/users/andersk/followers","following_url":"https://api.github.com/users/andersk/following{/other_user}","gists_url":"https://api.github.com/users/andersk/gists{/gist_id}","starred_url":"https://api.github.com/users/andersk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersk/subscriptions","organizations_url":"https://api.github.com/users/andersk/orgs","repos_url":"https://api.github.com/users/andersk/repos","events_url":"https://api.github.com/users/andersk/events{/privacy}","received_events_url":"https://api.github.com/users/andersk/received_events","type":"User","site_admin":false},"repo":{"id":41386324,"name":"oneliner","full_name":"andersk/oneliner","owner":{"login":"andersk","id":26471,"avatar_url":"https://avatars.githubusercontent.com/u/26471?v=3","gravatar_id":"","url":"https://api.github.com/users/andersk","html_url":"https://github.com/andersk","followers_url":"https://api.github.com/users/andersk/followers","following_url":"https://api.github.com/users/andersk/following{/other_user}","gists_url":"https://api.github.com/users/andersk/gists{/gist_id}","starred_url":"https://api.github.com/users/andersk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersk/subscriptions","organizations_url":"https://api.github.com/users/andersk/orgs","repos_url":"https://api.github.com/users/andersk/repos","events_url":"https://api.github.com/users/andersk/events{/privacy}","received_events_url":"https://api.github.com/users/andersk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andersk/oneliner","description":"Convert any Python file into a single line of code.","fork":true,"url":"https://api.github.com/repos/andersk/oneliner","forks_url":"https://api.github.com/repos/andersk/oneliner/forks","keys_url":"https://api.github.com/repos/andersk/oneliner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andersk/oneliner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andersk/oneliner/teams","hooks_url":"https://api.github.com/repos/andersk/oneliner/hooks","issue_events_url":"https://api.github.com/repos/andersk/oneliner/issues/events{/number}","events_url":"https://api.github.com/repos/andersk/oneliner/events","assignees_url":"https://api.github.com/repos/andersk/oneliner/assignees{/user}","branches_url":"https://api.github.com/repos/andersk/oneliner/branches{/branch}","tags_url":"https://api.github.com/repos/andersk/oneliner/tags","blobs_url":"https://api.github.com/repos/andersk/oneliner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andersk/oneliner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andersk/oneliner/git/refs{/sha}","trees_url":"https://api.github.com/repos/andersk/oneliner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andersk/oneliner/statuses/{sha}","languages_url":"https://api.github.com/repos/andersk/oneliner/languages","stargazers_url":"https://api.github.com/repos/andersk/oneliner/stargazers","contributors_url":"https://api.github.com/repos/andersk/oneliner/contributors","subscribers_url":"https://api.github.com/repos/andersk/oneliner/subscribers","subscription_url":"https://api.github.com/repos/andersk/oneliner/subscription","commits_url":"https://api.github.com/repos/andersk/oneliner/commits{/sha}","git_commits_url":"https://api.github.com/repos/andersk/oneliner/git/commits{/sha}","comments_url":"https://api.github.com/repos/andersk/oneliner/comments{/number}","issue_comment_url":"https://api.github.com/repos/andersk/oneliner/issues/comments{/number}","contents_url":"https://api.github.com/repos/andersk/oneliner/contents/{+path}","compare_url":"https://api.github.com/repos/andersk/oneliner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andersk/oneliner/merges","archive_url":"https://api.github.com/repos/andersk/oneliner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andersk/oneliner/downloads","issues_url":"https://api.github.com/repos/andersk/oneliner/issues{/number}","pulls_url":"https://api.github.com/repos/andersk/oneliner/pulls{/number}","milestones_url":"https://api.github.com/repos/andersk/oneliner/milestones{/number}","notifications_url":"https://api.github.com/repos/andersk/oneliner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andersk/oneliner/labels{/name}","releases_url":"https://api.github.com/repos/andersk/oneliner/releases{/id}","created_at":"2015-08-25T20:29:08Z","updated_at":"2015-09-05T13:58:30Z","pushed_at":"2015-09-10T17:49:48Z","git_url":"git://github.com/andersk/oneliner.git","ssh_url":"git@github.com:andersk/oneliner.git","clone_url":"https://github.com/andersk/oneliner.git","svn_url":"https://github.com/andersk/oneliner","homepage":null,"size":319,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"isatty"}},"base":{"label":"csvoss:master","ref":"master","sha":"b5706549a2ef0f6d7d474c6e174b13ddb4d3e373","user":{"login":"csvoss","id":3229696,"avatar_url":"https://avatars.githubusercontent.com/u/3229696?v=3","gravatar_id":"","url":"https://api.github.com/users/csvoss","html_url":"https://github.com/csvoss","followers_url":"https://api.github.com/users/csvoss/followers","following_url":"https://api.github.com/users/csvoss/following{/other_user}","gists_url":"https://api.github.com/users/csvoss/gists{/gist_id}","starred_url":"https://api.github.com/users/csvoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csvoss/subscriptions","organizations_url":"https://api.github.com/users/csvoss/orgs","repos_url":"https://api.github.com/users/csvoss/repos","events_url":"https://api.github.com/users/csvoss/events{/privacy}","received_events_url":"https://api.github.com/users/csvoss/received_events","type":"User","site_admin":false},"repo":{"id":29375764,"name":"oneliner","full_name":"csvoss/oneliner","owner":{"login":"csvoss","id":3229696,"avatar_url":"https://avatars.githubusercontent.com/u/3229696?v=3","gravatar_id":"","url":"https://api.github.com/users/csvoss","html_url":"https://github.com/csvoss","followers_url":"https://api.github.com/users/csvoss/followers","following_url":"https://api.github.com/users/csvoss/following{/other_user}","gists_url":"https://api.github.com/users/csvoss/gists{/gist_id}","starred_url":"https://api.github.com/users/csvoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csvoss/subscriptions","organizations_url":"https://api.github.com/users/csvoss/orgs","repos_url":"https://api.github.com/users/csvoss/repos","events_url":"https://api.github.com/users/csvoss/events{/privacy}","received_events_url":"https://api.github.com/users/csvoss/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/csvoss/oneliner","description":"Convert any Python file into a single line of code.","fork":false,"url":"https://api.github.com/repos/csvoss/oneliner","forks_url":"https://api.github.com/repos/csvoss/oneliner/forks","keys_url":"https://api.github.com/repos/csvoss/oneliner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csvoss/oneliner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csvoss/oneliner/teams","hooks_url":"https://api.github.com/repos/csvoss/oneliner/hooks","issue_events_url":"https://api.github.com/repos/csvoss/oneliner/issues/events{/number}","events_url":"https://api.github.com/repos/csvoss/oneliner/events","assignees_url":"https://api.github.com/repos/csvoss/oneliner/assignees{/user}","branches_url":"https://api.github.com/repos/csvoss/oneliner/branches{/branch}","tags_url":"https://api.github.com/repos/csvoss/oneliner/tags","blobs_url":"https://api.github.com/repos/csvoss/oneliner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csvoss/oneliner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csvoss/oneliner/git/refs{/sha}","trees_url":"https://api.github.com/repos/csvoss/oneliner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csvoss/oneliner/statuses/{sha}","languages_url":"https://api.github.com/repos/csvoss/oneliner/languages","stargazers_url":"https://api.github.com/repos/csvoss/oneliner/stargazers","contributors_url":"https://api.github.com/repos/csvoss/oneliner/contributors","subscribers_url":"https://api.github.com/repos/csvoss/oneliner/subscribers","subscription_url":"https://api.github.com/repos/csvoss/oneliner/subscription","commits_url":"https://api.github.com/repos/csvoss/oneliner/commits{/sha}","git_commits_url":"https://api.github.com/repos/csvoss/oneliner/git/commits{/sha}","comments_url":"https://api.github.com/repos/csvoss/oneliner/comments{/number}","issue_comment_url":"https://api.github.com/repos/csvoss/oneliner/issues/comments{/number}","contents_url":"https://api.github.com/repos/csvoss/oneliner/contents/{+path}","compare_url":"https://api.github.com/repos/csvoss/oneliner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csvoss/oneliner/merges","archive_url":"https://api.github.com/repos/csvoss/oneliner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csvoss/oneliner/downloads","issues_url":"https://api.github.com/repos/csvoss/oneliner/issues{/number}","pulls_url":"https://api.github.com/repos/csvoss/oneliner/pulls{/number}","milestones_url":"https://api.github.com/repos/csvoss/oneliner/milestones{/number}","notifications_url":"https://api.github.com/repos/csvoss/oneliner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csvoss/oneliner/labels{/name}","releases_url":"https://api.github.com/repos/csvoss/oneliner/releases{/id}","created_at":"2015-01-17T01:32:08Z","updated_at":"2015-09-10T01:24:20Z","pushed_at":"2015-09-10T23:21:35Z","git_url":"git://github.com/csvoss/oneliner.git","ssh_url":"git@github.com:csvoss/oneliner.git","clone_url":"https://github.com/csvoss/oneliner.git","svn_url":"https://github.com/csvoss/oneliner","homepage":"http://onelinepy.herokuapp.com/","size":666,"stargazers_count":422,"watchers_count":422,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":4,"forks":27,"open_issues":4,"watchers":422,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/csvoss/oneliner/pulls/44"},"html":{"href":"https://github.com/csvoss/oneliner/pull/44"},"issue":{"href":"https://api.github.com/repos/csvoss/oneliner/issues/44"},"comments":{"href":"https://api.github.com/repos/csvoss/oneliner/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/csvoss/oneliner/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/csvoss/oneliner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/csvoss/oneliner/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/csvoss/oneliner/statuses/7bd0cdabec8659d6d5a26bf2cfb945367d7c8b21"}}}}