{"action":"created","comment":{"url":"https://api.github.com/repos/hylang/hy/pulls/comments/23495918","id":23495918,"diff_hunk":"@@ -30,3 +30,5 @@ class HyComplex(HyObject, complex):\n     def __new__(cls, number, *args, **kwargs):\n         number = complex(number)\n         return super(HyComplex, cls).__new__(cls, number)\n+\n+_wrappers[complex] = HyComplex","path":"hy/models/complex.py","position":14,"original_position":14,"commit_id":"dc607763e2918b18a1809c3d410cf8e5a4a906e0","original_commit_id":"dc607763e2918b18a1809c3d410cf8e5a4a906e0","user":{"login":"larme","id":66847,"avatar_url":"https://avatars.githubusercontent.com/u/66847?v=3","gravatar_id":"","url":"https://api.github.com/users/larme","html_url":"https://github.com/larme","followers_url":"https://api.github.com/users/larme/followers","following_url":"https://api.github.com/users/larme/following{/other_user}","gists_url":"https://api.github.com/users/larme/gists{/gist_id}","starred_url":"https://api.github.com/users/larme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larme/subscriptions","organizations_url":"https://api.github.com/users/larme/orgs","repos_url":"https://api.github.com/users/larme/repos","events_url":"https://api.github.com/users/larme/events{/privacy}","received_events_url":"https://api.github.com/users/larme/received_events","type":"User","site_admin":false},"body":"We can, but it will create some circular imports because then `hy/models/__init__.py` need to `import hy/models/complex.py` etc.. I'm not sure which way is better.","created_at":"2015-01-24T11:44:30Z","updated_at":"2015-01-24T11:44:30Z","html_url":"https://github.com/hylang/hy/pull/761#discussion_r23495918","pull_request_url":"https://api.github.com/repos/hylang/hy/pulls/761","_links":{"self":{"href":"https://api.github.com/repos/hylang/hy/pulls/comments/23495918"},"html":{"href":"https://github.com/hylang/hy/pull/761#discussion_r23495918"},"pull_request":{"href":"https://api.github.com/repos/hylang/hy/pulls/761"}}},"pull_request":{"url":"https://api.github.com/repos/hylang/hy/pulls/761","id":27967828,"html_url":"https://github.com/hylang/hy/pull/761","diff_url":"https://github.com/hylang/hy/pull/761.diff","patch_url":"https://github.com/hylang/hy/pull/761.patch","issue_url":"https://api.github.com/repos/hylang/hy/issues/761","number":761,"state":"open","locked":false,"title":"Add 'replace_hy_obj' to safely replace Hy objects","user":{"login":"larme","id":66847,"avatar_url":"https://avatars.githubusercontent.com/u/66847?v=3","gravatar_id":"","url":"https://api.github.com/users/larme","html_url":"https://github.com/larme","followers_url":"https://api.github.com/users/larme/followers","following_url":"https://api.github.com/users/larme/following{/other_user}","gists_url":"https://api.github.com/users/larme/gists{/gist_id}","starred_url":"https://api.github.com/users/larme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larme/subscriptions","organizations_url":"https://api.github.com/users/larme/orgs","repos_url":"https://api.github.com/users/larme/repos","events_url":"https://api.github.com/users/larme/events{/privacy}","received_events_url":"https://api.github.com/users/larme/received_events","type":"User","site_admin":false},"body":" Currently '.replace' method is used to replace hy objects. This is not\r\nsafe when we are not sure if the 'obj' in 'obj.replace(other)' is an\r\ninstance of HyObject.\r\n\r\nIn these cases, we can use function 'replace_hy_obj(obj, other)'\r\ninstead. This function will try to wrap 'obj' if it's not an instance of\r\nHyObject.\r\n\r\nThis also means that we need a wrapping function in hy.models'. Hence I\r\nmoved the '_wrap_value' function from hy.macros into hy.models. To avoid\r\ncircular importing, the wrapper functions are provided individually by\r\neach model type's own file.","created_at":"2015-01-24T00:56:33Z","updated_at":"2015-01-24T11:44:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af81709abce5e489b6efb1418e385034fa31e8d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hylang/hy/pulls/761/commits","review_comments_url":"https://api.github.com/repos/hylang/hy/pulls/761/comments","review_comment_url":"https://api.github.com/repos/hylang/hy/pulls/comments/{number}","comments_url":"https://api.github.com/repos/hylang/hy/issues/761/comments","statuses_url":"https://api.github.com/repos/hylang/hy/statuses/dc607763e2918b18a1809c3d410cf8e5a4a906e0","head":{"label":"larme:fix-replace-hyobject","ref":"fix-replace-hyobject","sha":"dc607763e2918b18a1809c3d410cf8e5a4a906e0","user":{"login":"larme","id":66847,"avatar_url":"https://avatars.githubusercontent.com/u/66847?v=3","gravatar_id":"","url":"https://api.github.com/users/larme","html_url":"https://github.com/larme","followers_url":"https://api.github.com/users/larme/followers","following_url":"https://api.github.com/users/larme/following{/other_user}","gists_url":"https://api.github.com/users/larme/gists{/gist_id}","starred_url":"https://api.github.com/users/larme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larme/subscriptions","organizations_url":"https://api.github.com/users/larme/orgs","repos_url":"https://api.github.com/users/larme/repos","events_url":"https://api.github.com/users/larme/events{/privacy}","received_events_url":"https://api.github.com/users/larme/received_events","type":"User","site_admin":false},"repo":{"id":29749503,"name":"hy","full_name":"larme/hy","owner":{"login":"larme","id":66847,"avatar_url":"https://avatars.githubusercontent.com/u/66847?v=3","gravatar_id":"","url":"https://api.github.com/users/larme","html_url":"https://github.com/larme","followers_url":"https://api.github.com/users/larme/followers","following_url":"https://api.github.com/users/larme/following{/other_user}","gists_url":"https://api.github.com/users/larme/gists{/gist_id}","starred_url":"https://api.github.com/users/larme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larme/subscriptions","organizations_url":"https://api.github.com/users/larme/orgs","repos_url":"https://api.github.com/users/larme/repos","events_url":"https://api.github.com/users/larme/events{/privacy}","received_events_url":"https://api.github.com/users/larme/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/larme/hy","description":"ὑμήνπτερόν","fork":true,"url":"https://api.github.com/repos/larme/hy","forks_url":"https://api.github.com/repos/larme/hy/forks","keys_url":"https://api.github.com/repos/larme/hy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/larme/hy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/larme/hy/teams","hooks_url":"https://api.github.com/repos/larme/hy/hooks","issue_events_url":"https://api.github.com/repos/larme/hy/issues/events{/number}","events_url":"https://api.github.com/repos/larme/hy/events","assignees_url":"https://api.github.com/repos/larme/hy/assignees{/user}","branches_url":"https://api.github.com/repos/larme/hy/branches{/branch}","tags_url":"https://api.github.com/repos/larme/hy/tags","blobs_url":"https://api.github.com/repos/larme/hy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/larme/hy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/larme/hy/git/refs{/sha}","trees_url":"https://api.github.com/repos/larme/hy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/larme/hy/statuses/{sha}","languages_url":"https://api.github.com/repos/larme/hy/languages","stargazers_url":"https://api.github.com/repos/larme/hy/stargazers","contributors_url":"https://api.github.com/repos/larme/hy/contributors","subscribers_url":"https://api.github.com/repos/larme/hy/subscribers","subscription_url":"https://api.github.com/repos/larme/hy/subscription","commits_url":"https://api.github.com/repos/larme/hy/commits{/sha}","git_commits_url":"https://api.github.com/repos/larme/hy/git/commits{/sha}","comments_url":"https://api.github.com/repos/larme/hy/comments{/number}","issue_comment_url":"https://api.github.com/repos/larme/hy/issues/comments/{number}","contents_url":"https://api.github.com/repos/larme/hy/contents/{+path}","compare_url":"https://api.github.com/repos/larme/hy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/larme/hy/merges","archive_url":"https://api.github.com/repos/larme/hy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/larme/hy/downloads","issues_url":"https://api.github.com/repos/larme/hy/issues{/number}","pulls_url":"https://api.github.com/repos/larme/hy/pulls{/number}","milestones_url":"https://api.github.com/repos/larme/hy/milestones{/number}","notifications_url":"https://api.github.com/repos/larme/hy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/larme/hy/labels{/name}","releases_url":"https://api.github.com/repos/larme/hy/releases{/id}","created_at":"2015-01-23T19:35:36Z","updated_at":"2015-01-23T19:35:36Z","pushed_at":"2015-01-24T01:26:19Z","git_url":"git://github.com/larme/hy.git","ssh_url":"git@github.com:larme/hy.git","clone_url":"https://github.com/larme/hy.git","svn_url":"https://github.com/larme/hy","homepage":"http://hylang.org/","size":7638,"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":"master"}},"base":{"label":"hylang:master","ref":"master","sha":"8d6f9c3d84f56531e87f513d9a9a2e9cf2814911","user":{"login":"hylang","id":4141508,"avatar_url":"https://avatars.githubusercontent.com/u/4141508?v=3","gravatar_id":"","url":"https://api.github.com/users/hylang","html_url":"https://github.com/hylang","followers_url":"https://api.github.com/users/hylang/followers","following_url":"https://api.github.com/users/hylang/following{/other_user}","gists_url":"https://api.github.com/users/hylang/gists{/gist_id}","starred_url":"https://api.github.com/users/hylang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hylang/subscriptions","organizations_url":"https://api.github.com/users/hylang/orgs","repos_url":"https://api.github.com/users/hylang/repos","events_url":"https://api.github.com/users/hylang/events{/privacy}","received_events_url":"https://api.github.com/users/hylang/received_events","type":"Organization","site_admin":false},"repo":{"id":7184072,"name":"hy","full_name":"hylang/hy","owner":{"login":"hylang","id":4141508,"avatar_url":"https://avatars.githubusercontent.com/u/4141508?v=3","gravatar_id":"","url":"https://api.github.com/users/hylang","html_url":"https://github.com/hylang","followers_url":"https://api.github.com/users/hylang/followers","following_url":"https://api.github.com/users/hylang/following{/other_user}","gists_url":"https://api.github.com/users/hylang/gists{/gist_id}","starred_url":"https://api.github.com/users/hylang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hylang/subscriptions","organizations_url":"https://api.github.com/users/hylang/orgs","repos_url":"https://api.github.com/users/hylang/repos","events_url":"https://api.github.com/users/hylang/events{/privacy}","received_events_url":"https://api.github.com/users/hylang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hylang/hy","description":"ὑμήνπτερόν","fork":false,"url":"https://api.github.com/repos/hylang/hy","forks_url":"https://api.github.com/repos/hylang/hy/forks","keys_url":"https://api.github.com/repos/hylang/hy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hylang/hy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hylang/hy/teams","hooks_url":"https://api.github.com/repos/hylang/hy/hooks","issue_events_url":"https://api.github.com/repos/hylang/hy/issues/events{/number}","events_url":"https://api.github.com/repos/hylang/hy/events","assignees_url":"https://api.github.com/repos/hylang/hy/assignees{/user}","branches_url":"https://api.github.com/repos/hylang/hy/branches{/branch}","tags_url":"https://api.github.com/repos/hylang/hy/tags","blobs_url":"https://api.github.com/repos/hylang/hy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hylang/hy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hylang/hy/git/refs{/sha}","trees_url":"https://api.github.com/repos/hylang/hy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hylang/hy/statuses/{sha}","languages_url":"https://api.github.com/repos/hylang/hy/languages","stargazers_url":"https://api.github.com/repos/hylang/hy/stargazers","contributors_url":"https://api.github.com/repos/hylang/hy/contributors","subscribers_url":"https://api.github.com/repos/hylang/hy/subscribers","subscription_url":"https://api.github.com/repos/hylang/hy/subscription","commits_url":"https://api.github.com/repos/hylang/hy/commits{/sha}","git_commits_url":"https://api.github.com/repos/hylang/hy/git/commits{/sha}","comments_url":"https://api.github.com/repos/hylang/hy/comments{/number}","issue_comment_url":"https://api.github.com/repos/hylang/hy/issues/comments/{number}","contents_url":"https://api.github.com/repos/hylang/hy/contents/{+path}","compare_url":"https://api.github.com/repos/hylang/hy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hylang/hy/merges","archive_url":"https://api.github.com/repos/hylang/hy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hylang/hy/downloads","issues_url":"https://api.github.com/repos/hylang/hy/issues{/number}","pulls_url":"https://api.github.com/repos/hylang/hy/pulls{/number}","milestones_url":"https://api.github.com/repos/hylang/hy/milestones{/number}","notifications_url":"https://api.github.com/repos/hylang/hy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hylang/hy/labels{/name}","releases_url":"https://api.github.com/repos/hylang/hy/releases{/id}","created_at":"2012-12-15T21:20:51Z","updated_at":"2015-01-22T08:38:26Z","pushed_at":"2015-01-19T17:30:47Z","git_url":"git://github.com/hylang/hy.git","ssh_url":"git@github.com:hylang/hy.git","clone_url":"https://github.com/hylang/hy.git","svn_url":"https://github.com/hylang/hy","homepage":"http://hylang.org/","size":7638,"stargazers_count":954,"watchers_count":954,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":135,"mirror_url":null,"open_issues_count":137,"forks":135,"open_issues":137,"watchers":954,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hylang/hy/pulls/761"},"html":{"href":"https://github.com/hylang/hy/pull/761"},"issue":{"href":"https://api.github.com/repos/hylang/hy/issues/761"},"comments":{"href":"https://api.github.com/repos/hylang/hy/issues/761/comments"},"review_comments":{"href":"https://api.github.com/repos/hylang/hy/pulls/761/comments"},"review_comment":{"href":"https://api.github.com/repos/hylang/hy/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/hylang/hy/pulls/761/commits"},"statuses":{"href":"https://api.github.com/repos/hylang/hy/statuses/dc607763e2918b18a1809c3d410cf8e5a4a906e0"}}}}