{"action":"created","comment":{"url":"https://api.github.com/repos/berkerpeksag/astor/pulls/comments/112872854","pull_request_review_id":34218479,"id":112872854,"diff_hunk":"@@ -38,3 +40,38 @@\n all_symbols = symbol_data\n treewalk = tree_walk\n codegen = code_gen\n+\"\"\"\n+\n+exec(deprecated)\n+\n+def deprecate():\n+    def wrap(deprecated_name, target_name):\n+        if '.' in target_name:\n+            target_mod, target_fname = target_name.split('.')\n+            target_func = getattr(globals()[target_mod], target_fname)\n+        else:\n+            target_func = globals()[target_name]\n+        msg = \"astor.%s is deprecated.  Please use astor.%s.\" % (deprecated_name, target_name)\n+        if callable(target_func):\n+            def newfunc(*args, **kwarg):\n+                warnings.warn(msg, FutureWarning)\n+                return target_func(*args, **kwarg)\n+        else:\n+            class ModProxy:\n+                def __getattr__(self, name):\n+                    warnings.warn(msg, FutureWarning)","path":"astor/__init__.py","position":41,"original_position":41,"commit_id":"392519dc604658de3a2c07041817ac47c440de3a","original_commit_id":"392519dc604658de3a2c07041817ac47c440de3a","user":{"login":"berkerpeksag","id":26338,"avatar_url":"https://avatars2.githubusercontent.com/u/26338?v=3","gravatar_id":"","url":"https://api.github.com/users/berkerpeksag","html_url":"https://github.com/berkerpeksag","followers_url":"https://api.github.com/users/berkerpeksag/followers","following_url":"https://api.github.com/users/berkerpeksag/following{/other_user}","gists_url":"https://api.github.com/users/berkerpeksag/gists{/gist_id}","starred_url":"https://api.github.com/users/berkerpeksag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkerpeksag/subscriptions","organizations_url":"https://api.github.com/users/berkerpeksag/orgs","repos_url":"https://api.github.com/users/berkerpeksag/repos","events_url":"https://api.github.com/users/berkerpeksag/events{/privacy}","received_events_url":"https://api.github.com/users/berkerpeksag/received_events","type":"User","site_admin":false},"body":"We need to pass proper `stacklevel` values here. I think it should 4 or 5 for module level deprecations, but I don't know the other case.","created_at":"2017-04-24T06:35:15Z","updated_at":"2017-04-24T06:35:25Z","html_url":"https://github.com/berkerpeksag/astor/pull/66#discussion_r112872854","pull_request_url":"https://api.github.com/repos/berkerpeksag/astor/pulls/66","_links":{"self":{"href":"https://api.github.com/repos/berkerpeksag/astor/pulls/comments/112872854"},"html":{"href":"https://github.com/berkerpeksag/astor/pull/66#discussion_r112872854"},"pull_request":{"href":"https://api.github.com/repos/berkerpeksag/astor/pulls/66"}}},"pull_request":{"url":"https://api.github.com/repos/berkerpeksag/astor/pulls/66","id":117125269,"html_url":"https://github.com/berkerpeksag/astor/pull/66","diff_url":"https://github.com/berkerpeksag/astor/pull/66.diff","patch_url":"https://github.com/berkerpeksag/astor/pull/66.patch","issue_url":"https://api.github.com/repos/berkerpeksag/astor/issues/66","number":66,"state":"closed","locked":false,"title":"Deprecate old API (issue #59)","user":{"login":"pmaupin","id":2379062,"avatar_url":"https://avatars1.githubusercontent.com/u/2379062?v=3","gravatar_id":"","url":"https://api.github.com/users/pmaupin","html_url":"https://github.com/pmaupin","followers_url":"https://api.github.com/users/pmaupin/followers","following_url":"https://api.github.com/users/pmaupin/following{/other_user}","gists_url":"https://api.github.com/users/pmaupin/gists{/gist_id}","starred_url":"https://api.github.com/users/pmaupin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmaupin/subscriptions","organizations_url":"https://api.github.com/users/pmaupin/orgs","repos_url":"https://api.github.com/users/pmaupin/repos","events_url":"https://api.github.com/users/pmaupin/events{/privacy}","received_events_url":"https://api.github.com/users/pmaupin/received_events","type":"User","site_admin":false},"body":"DeprecationWarnings don't appear by default, so I used FutureWarning to insure it shows up.\r\n\r\nIf this is wrong, we can change.","created_at":"2017-04-22T21:07:09Z","updated_at":"2017-04-24T06:35:25Z","closed_at":"2017-04-22T21:10:56Z","merged_at":"2017-04-22T21:10:56Z","merge_commit_sha":"31fe3980157cebd715693ae706a75159ffd204bd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/berkerpeksag/astor/pulls/66/commits","review_comments_url":"https://api.github.com/repos/berkerpeksag/astor/pulls/66/comments","review_comment_url":"https://api.github.com/repos/berkerpeksag/astor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/berkerpeksag/astor/issues/66/comments","statuses_url":"https://api.github.com/repos/berkerpeksag/astor/statuses/392519dc604658de3a2c07041817ac47c440de3a","head":{"label":"berkerpeksag:deprecate_aliases","ref":"deprecate_aliases","sha":"392519dc604658de3a2c07041817ac47c440de3a","user":{"login":"berkerpeksag","id":26338,"avatar_url":"https://avatars2.githubusercontent.com/u/26338?v=3","gravatar_id":"","url":"https://api.github.com/users/berkerpeksag","html_url":"https://github.com/berkerpeksag","followers_url":"https://api.github.com/users/berkerpeksag/followers","following_url":"https://api.github.com/users/berkerpeksag/following{/other_user}","gists_url":"https://api.github.com/users/berkerpeksag/gists{/gist_id}","starred_url":"https://api.github.com/users/berkerpeksag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkerpeksag/subscriptions","organizations_url":"https://api.github.com/users/berkerpeksag/orgs","repos_url":"https://api.github.com/users/berkerpeksag/repos","events_url":"https://api.github.com/users/berkerpeksag/events{/privacy}","received_events_url":"https://api.github.com/users/berkerpeksag/received_events","type":"User","site_admin":false},"repo":{"id":5879214,"name":"astor","full_name":"berkerpeksag/astor","owner":{"login":"berkerpeksag","id":26338,"avatar_url":"https://avatars2.githubusercontent.com/u/26338?v=3","gravatar_id":"","url":"https://api.github.com/users/berkerpeksag","html_url":"https://github.com/berkerpeksag","followers_url":"https://api.github.com/users/berkerpeksag/followers","following_url":"https://api.github.com/users/berkerpeksag/following{/other_user}","gists_url":"https://api.github.com/users/berkerpeksag/gists{/gist_id}","starred_url":"https://api.github.com/users/berkerpeksag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkerpeksag/subscriptions","organizations_url":"https://api.github.com/users/berkerpeksag/orgs","repos_url":"https://api.github.com/users/berkerpeksag/repos","events_url":"https://api.github.com/users/berkerpeksag/events{/privacy}","received_events_url":"https://api.github.com/users/berkerpeksag/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/berkerpeksag/astor","description":"Python AST read/write","fork":false,"url":"https://api.github.com/repos/berkerpeksag/astor","forks_url":"https://api.github.com/repos/berkerpeksag/astor/forks","keys_url":"https://api.github.com/repos/berkerpeksag/astor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/berkerpeksag/astor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/berkerpeksag/astor/teams","hooks_url":"https://api.github.com/repos/berkerpeksag/astor/hooks","issue_events_url":"https://api.github.com/repos/berkerpeksag/astor/issues/events{/number}","events_url":"https://api.github.com/repos/berkerpeksag/astor/events","assignees_url":"https://api.github.com/repos/berkerpeksag/astor/assignees{/user}","branches_url":"https://api.github.com/repos/berkerpeksag/astor/branches{/branch}","tags_url":"https://api.github.com/repos/berkerpeksag/astor/tags","blobs_url":"https://api.github.com/repos/berkerpeksag/astor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/berkerpeksag/astor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/berkerpeksag/astor/git/refs{/sha}","trees_url":"https://api.github.com/repos/berkerpeksag/astor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/berkerpeksag/astor/statuses/{sha}","languages_url":"https://api.github.com/repos/berkerpeksag/astor/languages","stargazers_url":"https://api.github.com/repos/berkerpeksag/astor/stargazers","contributors_url":"https://api.github.com/repos/berkerpeksag/astor/contributors","subscribers_url":"https://api.github.com/repos/berkerpeksag/astor/subscribers","subscription_url":"https://api.github.com/repos/berkerpeksag/astor/subscription","commits_url":"https://api.github.com/repos/berkerpeksag/astor/commits{/sha}","git_commits_url":"https://api.github.com/repos/berkerpeksag/astor/git/commits{/sha}","comments_url":"https://api.github.com/repos/berkerpeksag/astor/comments{/number}","issue_comment_url":"https://api.github.com/repos/berkerpeksag/astor/issues/comments{/number}","contents_url":"https://api.github.com/repos/berkerpeksag/astor/contents/{+path}","compare_url":"https://api.github.com/repos/berkerpeksag/astor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/berkerpeksag/astor/merges","archive_url":"https://api.github.com/repos/berkerpeksag/astor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/berkerpeksag/astor/downloads","issues_url":"https://api.github.com/repos/berkerpeksag/astor/issues{/number}","pulls_url":"https://api.github.com/repos/berkerpeksag/astor/pulls{/number}","milestones_url":"https://api.github.com/repos/berkerpeksag/astor/milestones{/number}","notifications_url":"https://api.github.com/repos/berkerpeksag/astor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/berkerpeksag/astor/labels{/name}","releases_url":"https://api.github.com/repos/berkerpeksag/astor/releases{/id}","deployments_url":"https://api.github.com/repos/berkerpeksag/astor/deployments","created_at":"2012-09-19T23:02:51Z","updated_at":"2017-04-23T15:12:44Z","pushed_at":"2017-04-24T05:00:03Z","git_url":"git://github.com/berkerpeksag/astor.git","ssh_url":"git@github.com:berkerpeksag/astor.git","clone_url":"https://github.com/berkerpeksag/astor.git","svn_url":"https://github.com/berkerpeksag/astor","homepage":"https://pypi.python.org/pypi/astor","size":257,"stargazers_count":141,"watchers_count":141,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":12,"forks":25,"open_issues":12,"watchers":141,"default_branch":"master"}},"base":{"label":"berkerpeksag:master","ref":"master","sha":"4558703bde2bd5c4661d055dfc222f5e664b45b1","user":{"login":"berkerpeksag","id":26338,"avatar_url":"https://avatars2.githubusercontent.com/u/26338?v=3","gravatar_id":"","url":"https://api.github.com/users/berkerpeksag","html_url":"https://github.com/berkerpeksag","followers_url":"https://api.github.com/users/berkerpeksag/followers","following_url":"https://api.github.com/users/berkerpeksag/following{/other_user}","gists_url":"https://api.github.com/users/berkerpeksag/gists{/gist_id}","starred_url":"https://api.github.com/users/berkerpeksag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkerpeksag/subscriptions","organizations_url":"https://api.github.com/users/berkerpeksag/orgs","repos_url":"https://api.github.com/users/berkerpeksag/repos","events_url":"https://api.github.com/users/berkerpeksag/events{/privacy}","received_events_url":"https://api.github.com/users/berkerpeksag/received_events","type":"User","site_admin":false},"repo":{"id":5879214,"name":"astor","full_name":"berkerpeksag/astor","owner":{"login":"berkerpeksag","id":26338,"avatar_url":"https://avatars2.githubusercontent.com/u/26338?v=3","gravatar_id":"","url":"https://api.github.com/users/berkerpeksag","html_url":"https://github.com/berkerpeksag","followers_url":"https://api.github.com/users/berkerpeksag/followers","following_url":"https://api.github.com/users/berkerpeksag/following{/other_user}","gists_url":"https://api.github.com/users/berkerpeksag/gists{/gist_id}","starred_url":"https://api.github.com/users/berkerpeksag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkerpeksag/subscriptions","organizations_url":"https://api.github.com/users/berkerpeksag/orgs","repos_url":"https://api.github.com/users/berkerpeksag/repos","events_url":"https://api.github.com/users/berkerpeksag/events{/privacy}","received_events_url":"https://api.github.com/users/berkerpeksag/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/berkerpeksag/astor","description":"Python AST read/write","fork":false,"url":"https://api.github.com/repos/berkerpeksag/astor","forks_url":"https://api.github.com/repos/berkerpeksag/astor/forks","keys_url":"https://api.github.com/repos/berkerpeksag/astor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/berkerpeksag/astor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/berkerpeksag/astor/teams","hooks_url":"https://api.github.com/repos/berkerpeksag/astor/hooks","issue_events_url":"https://api.github.com/repos/berkerpeksag/astor/issues/events{/number}","events_url":"https://api.github.com/repos/berkerpeksag/astor/events","assignees_url":"https://api.github.com/repos/berkerpeksag/astor/assignees{/user}","branches_url":"https://api.github.com/repos/berkerpeksag/astor/branches{/branch}","tags_url":"https://api.github.com/repos/berkerpeksag/astor/tags","blobs_url":"https://api.github.com/repos/berkerpeksag/astor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/berkerpeksag/astor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/berkerpeksag/astor/git/refs{/sha}","trees_url":"https://api.github.com/repos/berkerpeksag/astor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/berkerpeksag/astor/statuses/{sha}","languages_url":"https://api.github.com/repos/berkerpeksag/astor/languages","stargazers_url":"https://api.github.com/repos/berkerpeksag/astor/stargazers","contributors_url":"https://api.github.com/repos/berkerpeksag/astor/contributors","subscribers_url":"https://api.github.com/repos/berkerpeksag/astor/subscribers","subscription_url":"https://api.github.com/repos/berkerpeksag/astor/subscription","commits_url":"https://api.github.com/repos/berkerpeksag/astor/commits{/sha}","git_commits_url":"https://api.github.com/repos/berkerpeksag/astor/git/commits{/sha}","comments_url":"https://api.github.com/repos/berkerpeksag/astor/comments{/number}","issue_comment_url":"https://api.github.com/repos/berkerpeksag/astor/issues/comments{/number}","contents_url":"https://api.github.com/repos/berkerpeksag/astor/contents/{+path}","compare_url":"https://api.github.com/repos/berkerpeksag/astor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/berkerpeksag/astor/merges","archive_url":"https://api.github.com/repos/berkerpeksag/astor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/berkerpeksag/astor/downloads","issues_url":"https://api.github.com/repos/berkerpeksag/astor/issues{/number}","pulls_url":"https://api.github.com/repos/berkerpeksag/astor/pulls{/number}","milestones_url":"https://api.github.com/repos/berkerpeksag/astor/milestones{/number}","notifications_url":"https://api.github.com/repos/berkerpeksag/astor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/berkerpeksag/astor/labels{/name}","releases_url":"https://api.github.com/repos/berkerpeksag/astor/releases{/id}","deployments_url":"https://api.github.com/repos/berkerpeksag/astor/deployments","created_at":"2012-09-19T23:02:51Z","updated_at":"2017-04-23T15:12:44Z","pushed_at":"2017-04-24T05:00:03Z","git_url":"git://github.com/berkerpeksag/astor.git","ssh_url":"git@github.com:berkerpeksag/astor.git","clone_url":"https://github.com/berkerpeksag/astor.git","svn_url":"https://github.com/berkerpeksag/astor","homepage":"https://pypi.python.org/pypi/astor","size":257,"stargazers_count":141,"watchers_count":141,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":12,"forks":25,"open_issues":12,"watchers":141,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/berkerpeksag/astor/pulls/66"},"html":{"href":"https://github.com/berkerpeksag/astor/pull/66"},"issue":{"href":"https://api.github.com/repos/berkerpeksag/astor/issues/66"},"comments":{"href":"https://api.github.com/repos/berkerpeksag/astor/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/berkerpeksag/astor/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/berkerpeksag/astor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/berkerpeksag/astor/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/berkerpeksag/astor/statuses/392519dc604658de3a2c07041817ac47c440de3a"}}}}
{"actor":{"display_login":"berkerpeksag"}}