{"action":"created","issue":{"url":"https://api.github.com/repos/pybee/voc/issues/556","repository_url":"https://api.github.com/repos/pybee/voc","labels_url":"https://api.github.com/repos/pybee/voc/issues/556/labels{/name}","comments_url":"https://api.github.com/repos/pybee/voc/issues/556/comments","events_url":"https://api.github.com/repos/pybee/voc/issues/556/events","html_url":"https://github.com/pybee/voc/pull/556","id":230557035,"number":556,"title":"Fix dict conversion errors for strings","user":{"login":"indexOutOfBound5","id":3903373,"avatar_url":"https://avatars1.githubusercontent.com/u/3903373?v=3","gravatar_id":"","url":"https://api.github.com/users/indexOutOfBound5","html_url":"https://github.com/indexOutOfBound5","followers_url":"https://api.github.com/users/indexOutOfBound5/followers","following_url":"https://api.github.com/users/indexOutOfBound5/following{/other_user}","gists_url":"https://api.github.com/users/indexOutOfBound5/gists{/gist_id}","starred_url":"https://api.github.com/users/indexOutOfBound5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indexOutOfBound5/subscriptions","organizations_url":"https://api.github.com/users/indexOutOfBound5/orgs","repos_url":"https://api.github.com/users/indexOutOfBound5/repos","events_url":"https://api.github.com/users/indexOutOfBound5/events{/privacy}","received_events_url":"https://api.github.com/users/indexOutOfBound5/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-23T00:45:30Z","updated_at":"2017-05-23T15:13:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pybee/voc/pulls/556","html_url":"https://github.com/pybee/voc/pull/556","diff_url":"https://github.com/pybee/voc/pull/556.diff","patch_url":"https://github.com/pybee/voc/pull/556.patch"},"body":"When sets and frozen sets were converted to dicts, if they contained\r\nstring elements those string elements would not be converted as they\r\nwould in python. Fix this.\r\n\r\nAs part of this commit, the mixed case unit test was removed, this is\r\ndue to randomisation present in sets in python 3.4 causing flakey tests.\r\n\r\nSigned-off-by: Meghan Halton <meghalton@gmail.com>\r\nSigned-off-by: Pamela McA'Nulty <pamela@mcanulty.org>"},"comment":{"url":"https://api.github.com/repos/pybee/voc/issues/comments/303430489","html_url":"https://github.com/pybee/voc/pull/556#issuecomment-303430489","issue_url":"https://api.github.com/repos/pybee/voc/issues/556","id":303430489,"user":{"login":"PamelaM","id":849341,"avatar_url":"https://avatars0.githubusercontent.com/u/849341?v=3","gravatar_id":"","url":"https://api.github.com/users/PamelaM","html_url":"https://github.com/PamelaM","followers_url":"https://api.github.com/users/PamelaM/followers","following_url":"https://api.github.com/users/PamelaM/following{/other_user}","gists_url":"https://api.github.com/users/PamelaM/gists{/gist_id}","starred_url":"https://api.github.com/users/PamelaM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PamelaM/subscriptions","organizations_url":"https://api.github.com/users/PamelaM/orgs","repos_url":"https://api.github.com/users/PamelaM/repos","events_url":"https://api.github.com/users/PamelaM/events{/privacy}","received_events_url":"https://api.github.com/users/PamelaM/received_events","type":"User","site_admin":false},"created_at":"2017-05-23T15:13:17Z","updated_at":"2017-05-23T15:13:17Z","body":"New suggestion:\r\nuse this (untested) code:\r\n\r\n```\r\nfrom itertools import permutations\r\ndef _all_permutaions(key, value):\r\n\t# If key is a text representation of a 'set', use itertools.permutations \r\n\tto generate all possible combinations for the key \r\n\t\r\n\tif key[0] != \"{\" or key[-1] != \"}\":\r\n\t\treturn value\r\n    return [\"{%s}\" % str(p)[1:-1]  for p in permutations(eval(key))]\r\n\r\nSAMPLE_SUBSTITUTIONS = {k: _all_permutations(k, v) for k, v in SAMPLE_SUBSTITUTIONS.items()}\r\n```\r\n\r\nShould make things _much_ easier, and all of the values for the set-string keys can default to `None`, so `SAMPLE_SUBSTITUTIONS` can become much more compact, readable code-wise"}}
{"actor":{"display_login":"PamelaM"}}