{"action":"created","issue":{"url":"https://api.github.com/repos/Psycojoker/redbaron/issues/65","labels_url":"https://api.github.com/repos/Psycojoker/redbaron/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/Psycojoker/redbaron/issues/65/comments","events_url":"https://api.github.com/repos/Psycojoker/redbaron/issues/65/events","html_url":"https://github.com/Psycojoker/redbaron/issues/65","id":69689569,"number":65,"title":"Inconsistance in numerical node behavior","user":{"login":"remram44","id":426784,"avatar_url":"https://avatars.githubusercontent.com/u/426784?v=3","gravatar_id":"","url":"https://api.github.com/users/remram44","html_url":"https://github.com/remram44","followers_url":"https://api.github.com/users/remram44/followers","following_url":"https://api.github.com/users/remram44/following{/other_user}","gists_url":"https://api.github.com/users/remram44/gists{/gist_id}","starred_url":"https://api.github.com/users/remram44/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remram44/subscriptions","organizations_url":"https://api.github.com/users/remram44/orgs","repos_url":"https://api.github.com/users/remram44/repos","events_url":"https://api.github.com/users/remram44/events{/privacy}","received_events_url":"https://api.github.com/users/remram44/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-20T21:50:50Z","updated_at":"2015-05-28T21:01:58Z","closed_at":"2015-05-28T21:01:58Z","body":"As far as I know, number literals can be one of `IntNode`, `FloatNode`, `OctaNode`, `HexaNode`, `LongNode`. However they don't appear in the code or doc, except for `IntNode`, which works differently because its value is a number instead of str.\r\n\r\nSo I'm left with:\r\n```python\r\ndef get_int_value(node):\r\n    NUMBERS = IntNode, FloatNode, OctaNode, HexaNode, LongNode\r\n\r\n    if isinstance(node, NUMBERS):\r\n        if isinstance(node, IntNode):\r\n            return node.value\r\n        else:\r\n            return ast.literal_eval(node.value)\r\n    else:\r\n        raise ValueError\r\n\r\ncode = RedBaron('a = 12\\na = 0xC')\r\nget_int_value(code[0].assign.value), get_int_value(code[1].assign.value)\r\n```"},"comment":{"url":"https://api.github.com/repos/Psycojoker/redbaron/issues/comments/106597931","html_url":"https://github.com/Psycojoker/redbaron/issues/65#issuecomment-106597931","issue_url":"https://api.github.com/repos/Psycojoker/redbaron/issues/65","id":106597931,"user":{"login":"remram44","id":426784,"avatar_url":"https://avatars.githubusercontent.com/u/426784?v=3","gravatar_id":"","url":"https://api.github.com/users/remram44","html_url":"https://github.com/remram44","followers_url":"https://api.github.com/users/remram44/followers","following_url":"https://api.github.com/users/remram44/following{/other_user}","gists_url":"https://api.github.com/users/remram44/gists{/gist_id}","starred_url":"https://api.github.com/users/remram44/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remram44/subscriptions","organizations_url":"https://api.github.com/users/remram44/orgs","repos_url":"https://api.github.com/users/remram44/repos","events_url":"https://api.github.com/users/remram44/events{/privacy}","received_events_url":"https://api.github.com/users/remram44/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T21:01:58Z","updated_at":"2015-05-28T21:01:58Z","body":"I'll be using that!"}}