{"action":"created","issue":{"url":"https://api.github.com/repos/ipython/traitlets/issues/52","labels_url":"https://api.github.com/repos/ipython/traitlets/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/ipython/traitlets/issues/52/comments","events_url":"https://api.github.com/repos/ipython/traitlets/issues/52/events","html_url":"https://github.com/ipython/traitlets/issues/52","id":95686191,"number":52,"title":"Initializing the metadata of a trait","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-07-17T15:56:20Z","updated_at":"2015-07-17T19:57:52Z","closed_at":null,"body":"This issue continues discussion of the metadata point from #48.  We'd like to separate the metadata from the constructor arguments in a TraitType's constructor:  Having the two semantically very different kwarg sets interleaved makes it very difficult to understand the constructor and predict what is going to happen.  \r\n\r\n```python\r\nx = Int(allow_none=True, sync=True)           # deprecated\r\n\r\n# option A1 - pass metadata in as a separate dict\r\nx = Int(allow_none=True, metadata={'sync': True})\r\nx = Int(allow_none=True, metadata=dict(sync=True))\r\n\r\n# option A2 - shorter argument name to save typing and line length\r\nx = Int(allow_none=True, md={'sync': True})\r\nx = Int(allow_none=True, md=dict(sync=True))\r\n\r\n# option B1 - set metadata in a function chained onto the constructor.  .metadata() should return self\r\nx = Int(allow_none=True).metadata(sync=True)\r\n\r\n# option B2 - shorter name\r\nx = Int(allow_none=True).md(sync=True)\r\n\r\n# option B3 - short name from atom, which is a good verb for this\r\nx = Int(allow_none=True).tag(sync=True)\r\n```\r\n\r\nTo be clear, we'd deprecate setting metadata in the constructor immediately, and remove the ability in traitlets 5.0."},"comment":{"url":"https://api.github.com/repos/ipython/traitlets/issues/comments/122395415","html_url":"https://github.com/ipython/traitlets/issues/52#issuecomment-122395415","issue_url":"https://api.github.com/repos/ipython/traitlets/issues/52","id":122395415,"user":{"login":"minrk","id":151929,"avatar_url":"https://avatars.githubusercontent.com/u/151929?v=3","gravatar_id":"","url":"https://api.github.com/users/minrk","html_url":"https://github.com/minrk","followers_url":"https://api.github.com/users/minrk/followers","following_url":"https://api.github.com/users/minrk/following{/other_user}","gists_url":"https://api.github.com/users/minrk/gists{/gist_id}","starred_url":"https://api.github.com/users/minrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minrk/subscriptions","organizations_url":"https://api.github.com/users/minrk/orgs","repos_url":"https://api.github.com/users/minrk/repos","events_url":"https://api.github.com/users/minrk/events{/privacy}","received_events_url":"https://api.github.com/users/minrk/received_events","type":"User","site_admin":false},"created_at":"2015-07-17T19:57:52Z","updated_at":"2015-07-17T19:57:52Z","body":"Any backward-incompatible changes here are going to have to go through a long (at least a year or two) deprecation cycle."}}