{"action":"created","issue":{"url":"https://api.github.com/repos/robshakir/pyangbind/issues/15","labels_url":"https://api.github.com/repos/robshakir/pyangbind/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/robshakir/pyangbind/issues/15/comments","events_url":"https://api.github.com/repos/robshakir/pyangbind/issues/15/events","html_url":"https://github.com/robshakir/pyangbind/issues/15","id":117630787,"number":15,"title":"No support for complex ranges","user":{"login":"marksutherland","id":109183,"avatar_url":"https://avatars.githubusercontent.com/u/109183?v=3","gravatar_id":"","url":"https://api.github.com/users/marksutherland","html_url":"https://github.com/marksutherland","followers_url":"https://api.github.com/users/marksutherland/followers","following_url":"https://api.github.com/users/marksutherland/following{/other_user}","gists_url":"https://api.github.com/users/marksutherland/gists{/gist_id}","starred_url":"https://api.github.com/users/marksutherland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marksutherland/subscriptions","organizations_url":"https://api.github.com/users/marksutherland/orgs","repos_url":"https://api.github.com/users/marksutherland/repos","events_url":"https://api.github.com/users/marksutherland/events{/privacy}","received_events_url":"https://api.github.com/users/marksutherland/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/robshakir/pyangbind/labels/implemented","name":"implemented","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-18T16:55:02Z","updated_at":"2015-12-02T21:07:54Z","closed_at":"2015-12-02T01:18:12Z","body":"RFC 6020 allows ranges to be discontinuous, using the | to separate each sub-range, as long as the range delimiters increase from left to right. For example the following is allowed:\r\n\r\n```\r\ntype int8 {\r\n    range \"-10 .. -5 | 5 .. 10 | 20 .. 30\"\r\n}\r\n```\r\nSee section 9.2.4 for details: https://tools.ietf.org/html/rfc6020#section-9.2.4\r\nThis also seems to apply to string lengths: https://tools.ietf.org/html/rfc6020#section-9.4.4\r\n\r\nIf such a range exists in an input yang file, the follow error occurs:\r\n\r\n```\r\n  File \"/home/msuther/Repositories/pyangbind/lib/yangtypes.py\", line 839, in YANGDynClass\r\n    return YANGBaseClass(*args, **kwargs)\r\n  File \"/home/msuther/Repositories/pyangbind/lib/yangtypes.py\", line 717, in __init__\r\n    raise TypeError, \"couldn't generate dynamic type -> %s -> %s\" % (type(e),e)\r\nTypeError: couldn't generate dynamic type -> <type 'exceptions.ValueError'> -> too many values to unpack\r\n```"},"comment":{"url":"https://api.github.com/repos/robshakir/pyangbind/issues/comments/161434246","html_url":"https://github.com/robshakir/pyangbind/issues/15#issuecomment-161434246","issue_url":"https://api.github.com/repos/robshakir/pyangbind/issues/15","id":161434246,"user":{"login":"marksutherland","id":109183,"avatar_url":"https://avatars.githubusercontent.com/u/109183?v=3","gravatar_id":"","url":"https://api.github.com/users/marksutherland","html_url":"https://github.com/marksutherland","followers_url":"https://api.github.com/users/marksutherland/followers","following_url":"https://api.github.com/users/marksutherland/following{/other_user}","gists_url":"https://api.github.com/users/marksutherland/gists{/gist_id}","starred_url":"https://api.github.com/users/marksutherland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marksutherland/subscriptions","organizations_url":"https://api.github.com/users/marksutherland/orgs","repos_url":"https://api.github.com/users/marksutherland/repos","events_url":"https://api.github.com/users/marksutherland/events{/privacy}","received_events_url":"https://api.github.com/users/marksutherland/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T21:07:54Z","updated_at":"2015-12-02T21:07:54Z","body":"Hi @robshakir,\n\nThanks! I’ve verified that it works with the yang I was using as well. Hope\nyou had a nice break!\n\nOn 2 December 2015 at 01:18, Rob Shakir <notifications@github.com> wrote:\n\n> @marksutherland <https://github.com/marksutherland>\n>\n> Hi Mark,\n>\n> Apologies, missed this issue with the Thanksgiving break -- please see\n> changes in ed2c2b1\n> <https://github.com/robshakir/pyangbind/commit/ed2c2b156b78ff9b0296bfe13db36aa5fda384cc>\n> which do as you suggest and add the same semantics to length as are\n> implemented for range.\n>\n> Any issues please re-open this issue.\n>\n> Cheers,\n> r.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/robshakir/pyangbind/issues/15#issuecomment-161148423>.\n>\n"}}