{"action":"closed","issue":{"url":"https://api.github.com/repos/gvvaughan/lyaml/issues/7","labels_url":"https://api.github.com/repos/gvvaughan/lyaml/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/gvvaughan/lyaml/issues/7/comments","events_url":"https://api.github.com/repos/gvvaughan/lyaml/issues/7/events","html_url":"https://github.com/gvvaughan/lyaml/issues/7","id":89926100,"number":7,"title":"Purpose of nested table required for dumping?","user":{"login":"GUI","id":12112,"avatar_url":"https://avatars.githubusercontent.com/u/12112?v=3","gravatar_id":"","url":"https://api.github.com/users/GUI","html_url":"https://github.com/GUI","followers_url":"https://api.github.com/users/GUI/followers","following_url":"https://api.github.com/users/GUI/following{/other_user}","gists_url":"https://api.github.com/users/GUI/gists{/gist_id}","starred_url":"https://api.github.com/users/GUI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GUI/subscriptions","organizations_url":"https://api.github.com/users/GUI/orgs","repos_url":"https://api.github.com/users/GUI/repos","events_url":"https://api.github.com/users/GUI/events{/privacy}","received_events_url":"https://api.github.com/users/GUI/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-21T15:48:57Z","updated_at":"2015-07-10T21:36:26Z","closed_at":"2015-07-10T21:36:26Z","body":"I was curious why, when dumping a table, I have to wrap it inside another table. For example, this returns an empty string:\r\n\r\n```\r\n> print(lyaml.dump({ foo = \"bar\" }))\r\n\r\n```\r\n\r\nWhereas if I wrap my table inside another, then I get the expected output:\r\n\r\n```\r\n> print(lyaml.dump({{ foo = \"bar\" }}))\r\n---\r\nfoo: bar\r\n…\r\n```\r\n\r\nThis seems confusing since it means I can't actually use `lyaml.dump` on a table previously parsed with `lyaml.load` without manually adding this extra wrapper table:\r\n\r\n```\r\n> print(lyaml.dump(lyaml.load(\"foo: bar\")))\r\n\r\n> print(lyaml.dump({ lyaml.load(\"foo: bar\") }))\r\n---\r\nfoo: bar\r\n…\r\n```\r\n\r\nI would expect that first example to work, since intuitively it seems like I should be able to dump something that the library loads without tweaking the object.\r\n\r\nSo my primary question is whether or not this extra table is purposeful in the lyaml dump API. If it is, then it's easy enough to workaround, but I might recommend documenting it more clearly in the README (I had to look at the test suite to understand this). I'd be happy to submit a pull request with some documentation updates, but I first just wanted to make sure this design was intended when dumping tables."}}