{"action":"created","comment":{"url":"https://api.github.com/repos/ipython/traitlets/pulls/comments/38589563","id":38589563,"diff_hunk":"@@ -908,6 +965,32 @@ def unobserve_all(self):\n         \"\"\"Remove all trait change handlers.\"\"\"\n         self._trait_notifiers = {}\n \n+    def register_validator(self, handler, name):","path":"traitlets/traitlets.py","position":136,"original_position":140,"commit_id":"0e2869d635e37bf343c2f1024ad990f134060f88","original_commit_id":"2d4f3d3c582313985ecfb11af82d700f08f0dbe4","user":{"login":"jasongrout","id":192614,"avatar_url":"https://avatars.githubusercontent.com/u/192614?v=3","gravatar_id":"","url":"https://api.github.com/users/jasongrout","html_url":"https://github.com/jasongrout","followers_url":"https://api.github.com/users/jasongrout/followers","following_url":"https://api.github.com/users/jasongrout/following{/other_user}","gists_url":"https://api.github.com/users/jasongrout/gists{/gist_id}","starred_url":"https://api.github.com/users/jasongrout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasongrout/subscriptions","organizations_url":"https://api.github.com/users/jasongrout/orgs","repos_url":"https://api.github.com/users/jasongrout/repos","events_url":"https://api.github.com/users/jasongrout/events{/privacy}","received_events_url":"https://api.github.com/users/jasongrout/received_events","type":"User","site_admin":false},"body":"I thought we decided to only support decorators for HasTraits methods, which would mean that register_validator would be a private detail.  @ellisonbg, what do you think?","created_at":"2015-09-02T21:52:41Z","updated_at":"2015-09-02T21:52:41Z","html_url":"https://github.com/ipython/traitlets/pull/73#discussion_r38589563","pull_request_url":"https://api.github.com/repos/ipython/traitlets/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/ipython/traitlets/pulls/comments/38589563"},"html":{"href":"https://github.com/ipython/traitlets/pull/73#discussion_r38589563"},"pull_request":{"href":"https://api.github.com/repos/ipython/traitlets/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/ipython/traitlets/pulls/73","id":43590155,"html_url":"https://github.com/ipython/traitlets/pull/73","diff_url":"https://github.com/ipython/traitlets/pull/73.diff","patch_url":"https://github.com/ipython/traitlets/pull/73.patch","issue_url":"https://api.github.com/repos/ipython/traitlets/issues/73","number":73,"state":"open","locked":false,"title":"Cross Validation Using New Observe API","user":{"login":"rmorshea","id":4041990,"avatar_url":"https://avatars.githubusercontent.com/u/4041990?v=3","gravatar_id":"","url":"https://api.github.com/users/rmorshea","html_url":"https://github.com/rmorshea","followers_url":"https://api.github.com/users/rmorshea/followers","following_url":"https://api.github.com/users/rmorshea/following{/other_user}","gists_url":"https://api.github.com/users/rmorshea/gists{/gist_id}","starred_url":"https://api.github.com/users/rmorshea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmorshea/subscriptions","organizations_url":"https://api.github.com/users/rmorshea/orgs","repos_url":"https://api.github.com/users/rmorshea/repos","events_url":"https://api.github.com/users/rmorshea/events{/privacy}","received_events_url":"https://api.github.com/users/rmorshea/received_events","type":"User","site_admin":false},"body":"brief example\r\n\r\n```python\r\n\r\nfrom traitlets import HasTraits, Int, validate\r\n\r\nclass H(HasTraits):\r\n    \r\n    i = Int()\r\n    \r\n    @validate('i')\r\n    def _i_validator(self, proposal):\r\n        return proposal['value']+1\r\n\r\nh  = H()\r\nh.i = 1\r\nprint('result : '+ str(h.i))\r\n```\r\n\r\n`'result : 2'`\r\n","created_at":"2015-08-28T03:22:39Z","updated_at":"2015-09-02T21:52:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31e467b8e028df1e09bc7aefcb022878b3f255ca","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ipython/traitlets/pulls/73/commits","review_comments_url":"https://api.github.com/repos/ipython/traitlets/pulls/73/comments","review_comment_url":"https://api.github.com/repos/ipython/traitlets/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ipython/traitlets/issues/73/comments","statuses_url":"https://api.github.com/repos/ipython/traitlets/statuses/0e2869d635e37bf343c2f1024ad990f134060f88","head":{"label":"rmorshea:observe_validate","ref":"observe_validate","sha":"0e2869d635e37bf343c2f1024ad990f134060f88","user":{"login":"rmorshea","id":4041990,"avatar_url":"https://avatars.githubusercontent.com/u/4041990?v=3","gravatar_id":"","url":"https://api.github.com/users/rmorshea","html_url":"https://github.com/rmorshea","followers_url":"https://api.github.com/users/rmorshea/followers","following_url":"https://api.github.com/users/rmorshea/following{/other_user}","gists_url":"https://api.github.com/users/rmorshea/gists{/gist_id}","starred_url":"https://api.github.com/users/rmorshea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmorshea/subscriptions","organizations_url":"https://api.github.com/users/rmorshea/orgs","repos_url":"https://api.github.com/users/rmorshea/repos","events_url":"https://api.github.com/users/rmorshea/events{/privacy}","received_events_url":"https://api.github.com/users/rmorshea/received_events","type":"User","site_admin":false},"repo":{"id":37481051,"name":"traitlets","full_name":"rmorshea/traitlets","owner":{"login":"rmorshea","id":4041990,"avatar_url":"https://avatars.githubusercontent.com/u/4041990?v=3","gravatar_id":"","url":"https://api.github.com/users/rmorshea","html_url":"https://github.com/rmorshea","followers_url":"https://api.github.com/users/rmorshea/followers","following_url":"https://api.github.com/users/rmorshea/following{/other_user}","gists_url":"https://api.github.com/users/rmorshea/gists{/gist_id}","starred_url":"https://api.github.com/users/rmorshea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmorshea/subscriptions","organizations_url":"https://api.github.com/users/rmorshea/orgs","repos_url":"https://api.github.com/users/rmorshea/repos","events_url":"https://api.github.com/users/rmorshea/events{/privacy}","received_events_url":"https://api.github.com/users/rmorshea/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rmorshea/traitlets","description":"A lightweight Traits like module","fork":true,"url":"https://api.github.com/repos/rmorshea/traitlets","forks_url":"https://api.github.com/repos/rmorshea/traitlets/forks","keys_url":"https://api.github.com/repos/rmorshea/traitlets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmorshea/traitlets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmorshea/traitlets/teams","hooks_url":"https://api.github.com/repos/rmorshea/traitlets/hooks","issue_events_url":"https://api.github.com/repos/rmorshea/traitlets/issues/events{/number}","events_url":"https://api.github.com/repos/rmorshea/traitlets/events","assignees_url":"https://api.github.com/repos/rmorshea/traitlets/assignees{/user}","branches_url":"https://api.github.com/repos/rmorshea/traitlets/branches{/branch}","tags_url":"https://api.github.com/repos/rmorshea/traitlets/tags","blobs_url":"https://api.github.com/repos/rmorshea/traitlets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmorshea/traitlets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmorshea/traitlets/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmorshea/traitlets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmorshea/traitlets/statuses/{sha}","languages_url":"https://api.github.com/repos/rmorshea/traitlets/languages","stargazers_url":"https://api.github.com/repos/rmorshea/traitlets/stargazers","contributors_url":"https://api.github.com/repos/rmorshea/traitlets/contributors","subscribers_url":"https://api.github.com/repos/rmorshea/traitlets/subscribers","subscription_url":"https://api.github.com/repos/rmorshea/traitlets/subscription","commits_url":"https://api.github.com/repos/rmorshea/traitlets/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmorshea/traitlets/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmorshea/traitlets/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmorshea/traitlets/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmorshea/traitlets/contents/{+path}","compare_url":"https://api.github.com/repos/rmorshea/traitlets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmorshea/traitlets/merges","archive_url":"https://api.github.com/repos/rmorshea/traitlets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmorshea/traitlets/downloads","issues_url":"https://api.github.com/repos/rmorshea/traitlets/issues{/number}","pulls_url":"https://api.github.com/repos/rmorshea/traitlets/pulls{/number}","milestones_url":"https://api.github.com/repos/rmorshea/traitlets/milestones{/number}","notifications_url":"https://api.github.com/repos/rmorshea/traitlets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmorshea/traitlets/labels{/name}","releases_url":"https://api.github.com/repos/rmorshea/traitlets/releases{/id}","created_at":"2015-06-15T17:48:57Z","updated_at":"2015-06-15T17:48:58Z","pushed_at":"2015-09-02T21:12:35Z","git_url":"git://github.com/rmorshea/traitlets.git","ssh_url":"git@github.com:rmorshea/traitlets.git","clone_url":"https://github.com/rmorshea/traitlets.git","svn_url":"https://github.com/rmorshea/traitlets","homepage":null,"size":758,"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":"ipython:master","ref":"master","sha":"1d32f73c1a344a5043744aef4778dbbfa5ae32c4","user":{"login":"ipython","id":230453,"avatar_url":"https://avatars.githubusercontent.com/u/230453?v=3","gravatar_id":"","url":"https://api.github.com/users/ipython","html_url":"https://github.com/ipython","followers_url":"https://api.github.com/users/ipython/followers","following_url":"https://api.github.com/users/ipython/following{/other_user}","gists_url":"https://api.github.com/users/ipython/gists{/gist_id}","starred_url":"https://api.github.com/users/ipython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipython/subscriptions","organizations_url":"https://api.github.com/users/ipython/orgs","repos_url":"https://api.github.com/users/ipython/repos","events_url":"https://api.github.com/users/ipython/events{/privacy}","received_events_url":"https://api.github.com/users/ipython/received_events","type":"Organization","site_admin":false},"repo":{"id":14993021,"name":"traitlets","full_name":"ipython/traitlets","owner":{"login":"ipython","id":230453,"avatar_url":"https://avatars.githubusercontent.com/u/230453?v=3","gravatar_id":"","url":"https://api.github.com/users/ipython","html_url":"https://github.com/ipython","followers_url":"https://api.github.com/users/ipython/followers","following_url":"https://api.github.com/users/ipython/following{/other_user}","gists_url":"https://api.github.com/users/ipython/gists{/gist_id}","starred_url":"https://api.github.com/users/ipython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipython/subscriptions","organizations_url":"https://api.github.com/users/ipython/orgs","repos_url":"https://api.github.com/users/ipython/repos","events_url":"https://api.github.com/users/ipython/events{/privacy}","received_events_url":"https://api.github.com/users/ipython/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipython/traitlets","description":"A lightweight Traits like module","fork":false,"url":"https://api.github.com/repos/ipython/traitlets","forks_url":"https://api.github.com/repos/ipython/traitlets/forks","keys_url":"https://api.github.com/repos/ipython/traitlets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipython/traitlets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipython/traitlets/teams","hooks_url":"https://api.github.com/repos/ipython/traitlets/hooks","issue_events_url":"https://api.github.com/repos/ipython/traitlets/issues/events{/number}","events_url":"https://api.github.com/repos/ipython/traitlets/events","assignees_url":"https://api.github.com/repos/ipython/traitlets/assignees{/user}","branches_url":"https://api.github.com/repos/ipython/traitlets/branches{/branch}","tags_url":"https://api.github.com/repos/ipython/traitlets/tags","blobs_url":"https://api.github.com/repos/ipython/traitlets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipython/traitlets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipython/traitlets/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipython/traitlets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipython/traitlets/statuses/{sha}","languages_url":"https://api.github.com/repos/ipython/traitlets/languages","stargazers_url":"https://api.github.com/repos/ipython/traitlets/stargazers","contributors_url":"https://api.github.com/repos/ipython/traitlets/contributors","subscribers_url":"https://api.github.com/repos/ipython/traitlets/subscribers","subscription_url":"https://api.github.com/repos/ipython/traitlets/subscription","commits_url":"https://api.github.com/repos/ipython/traitlets/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipython/traitlets/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipython/traitlets/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipython/traitlets/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipython/traitlets/contents/{+path}","compare_url":"https://api.github.com/repos/ipython/traitlets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipython/traitlets/merges","archive_url":"https://api.github.com/repos/ipython/traitlets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipython/traitlets/downloads","issues_url":"https://api.github.com/repos/ipython/traitlets/issues{/number}","pulls_url":"https://api.github.com/repos/ipython/traitlets/pulls{/number}","milestones_url":"https://api.github.com/repos/ipython/traitlets/milestones{/number}","notifications_url":"https://api.github.com/repos/ipython/traitlets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipython/traitlets/labels{/name}","releases_url":"https://api.github.com/repos/ipython/traitlets/releases{/id}","created_at":"2013-12-06T20:45:45Z","updated_at":"2015-09-01T12:29:07Z","pushed_at":"2015-09-02T21:12:36Z","git_url":"git://github.com/ipython/traitlets.git","ssh_url":"git@github.com:ipython/traitlets.git","clone_url":"https://github.com/ipython/traitlets.git","svn_url":"https://github.com/ipython/traitlets","homepage":"http://traitlets.readthedocs.org/","size":2469,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":9,"forks":28,"open_issues":9,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ipython/traitlets/pulls/73"},"html":{"href":"https://github.com/ipython/traitlets/pull/73"},"issue":{"href":"https://api.github.com/repos/ipython/traitlets/issues/73"},"comments":{"href":"https://api.github.com/repos/ipython/traitlets/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/ipython/traitlets/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/ipython/traitlets/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ipython/traitlets/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/ipython/traitlets/statuses/0e2869d635e37bf343c2f1024ad990f134060f88"}}}}