{"action":"created","issue":{"url":"https://api.github.com/repos/akesterson/dpath-python/issues/47","labels_url":"https://api.github.com/repos/akesterson/dpath-python/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/akesterson/dpath-python/issues/47/comments","events_url":"https://api.github.com/repos/akesterson/dpath-python/issues/47/events","html_url":"https://github.com/akesterson/dpath-python/issues/47","id":117674788,"number":47,"title":"dpath.util.new expecting int at the end of new nested paths","user":{"login":"jackmaney","id":1554625,"avatar_url":"https://avatars.githubusercontent.com/u/1554625?v=3","gravatar_id":"","url":"https://api.github.com/users/jackmaney","html_url":"https://github.com/jackmaney","followers_url":"https://api.github.com/users/jackmaney/followers","following_url":"https://api.github.com/users/jackmaney/following{/other_user}","gists_url":"https://api.github.com/users/jackmaney/gists{/gist_id}","starred_url":"https://api.github.com/users/jackmaney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackmaney/subscriptions","organizations_url":"https://api.github.com/users/jackmaney/orgs","repos_url":"https://api.github.com/users/jackmaney/repos","events_url":"https://api.github.com/users/jackmaney/events{/privacy}","received_events_url":"https://api.github.com/users/jackmaney/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-18T20:29:51Z","updated_at":"2015-11-20T19:34:58Z","closed_at":null,"body":"OS X 10.9.5\r\nTested on Python 3.5.0, 3.4.3, and 2.7.10\r\n\r\nSo, I'm trying to use dpath in one of my projects, and the examples in the README docs work just fine. However, when I fiddle around on my own, `dpath.util.new` seems to think I want to tack on an array when I really don't:\r\n\r\n```\r\nIn [1]: import dpath.util\r\n\r\nIn [2]: d = {\"a\": 1, \"b\": 2}\r\n\r\nIn [3]: dpath.util.new(d, \"a/c\", \"something\")\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n/Users/[username]/.pyenv/versions/3.5.0/lib/python3.5/site-packages/dpath/path.py in path_types(obj, path)\r\n     29         try:\r\n---> 30             result.append([path[-1], cur[path[-1]].__class__])\r\n     31         except TypeError:\r\n\r\nTypeError: 'int' object is not subscriptable\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-3-e13767a0cab0> in <module>()\r\n----> 1 dpath.util.new(d, \"a/c\", \"something\")\r\n\r\n/Users/[username]/.pyenv/versions/3.5.0/lib/python3.5/site-packages/dpath/util.py in new(obj, path, value, separator)\r\n     44     \"\"\"\r\n     45     pathlist = __safe_path__(path, separator)\r\n---> 46     pathobj = dpath.path.path_types(obj, pathlist)\r\n     47     return dpath.path.set(obj, pathobj, value, create_missing=True)\r\n     48\r\n\r\n/Users/[username]/.pyenv/versions/3.5.0/lib/python3.5/site-packages/dpath/path.py in path_types(obj, path)\r\n     30             result.append([path[-1], cur[path[-1]].__class__])\r\n     31         except TypeError:\r\n---> 32             result.append([path[-1], cur[int(path[-1])].__class__])\r\n     33     except (KeyError, IndexError):\r\n     34         result.append([path[-1], path[-1].__class__])\r\n\r\nValueError: invalid literal for int() with base 10: 'c'\r\n```\r\n\r\nI don't understand what the substantive difference is between this and [the analogous example in the docs](https://github.com/akesterson/dpath-python#example-adding-new-keys). Am I missing anything obvious, here?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/akesterson/dpath-python/issues/comments/158503767","html_url":"https://github.com/akesterson/dpath-python/issues/47#issuecomment-158503767","issue_url":"https://api.github.com/repos/akesterson/dpath-python/issues/47","id":158503767,"user":{"login":"jackmaney","id":1554625,"avatar_url":"https://avatars.githubusercontent.com/u/1554625?v=3","gravatar_id":"","url":"https://api.github.com/users/jackmaney","html_url":"https://github.com/jackmaney","followers_url":"https://api.github.com/users/jackmaney/followers","following_url":"https://api.github.com/users/jackmaney/following{/other_user}","gists_url":"https://api.github.com/users/jackmaney/gists{/gist_id}","starred_url":"https://api.github.com/users/jackmaney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackmaney/subscriptions","organizations_url":"https://api.github.com/users/jackmaney/orgs","repos_url":"https://api.github.com/users/jackmaney/repos","events_url":"https://api.github.com/users/jackmaney/events{/privacy}","received_events_url":"https://api.github.com/users/jackmaney/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T19:34:58Z","updated_at":"2015-11-20T19:34:58Z","body":"1.4.0\r\n\r\nAlso, would it be possible to request the addition of a `__version__` attribute to the `dpath` module? That would make finding the version a fair amount easier. :)"}}