Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 91
Leaf#123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Leaf #123
Changes from all commits
919d99ae06d5d901933d1bbae563348cc3b3026964fa59b5361bfc0fFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| import collections | ||
| from copy import deepcopy | ||
| from datetime import datetime | ||
| from dpath.exceptions import InvalidGlob, InvalidKeyName, PathNotFound | ||
| from dpath import options | ||
| from fnmatch import fnmatchcase | ||
| import six | ||
| def kvs(node): | ||
| @@ -22,9 +25,11 @@ def leaf(thing): | ||
| leaf(thing) -> bool | ||
| ''' | ||
| leaves = (bytes, str, int, float, bool, type(None)) | ||
| return isinstance(thing, leaves) | ||
| return ( | ||
| not isinstance(thing, collections.abc.Container) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will break on Python 2. At the top, put: try:
importcollections.abcascollections_abcexceptImportError:
# Python 2importcollectionsascollections_abcThis line would then use Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. v2 and onward will not support python 2.7 because it is EOL. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I see. I saw some other compatibility stuff so I assumed you were still supporting it. I recommend adding the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i get recursion error with only return not isinstance(thing, collections.abc.Container). For me , it works with: best regards There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Weird...what was the data you were working with? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it's weird. Test with datesException has occurred: RecursionError Hope it help. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dpath version: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh wait you're missing the orisinstance(thing, six.string_types)
orisinstance(thing, six.binary_type)
)part | ||
| or isinstance(thing, six.string_types) | ||
| or isinstance(thing, six.binary_type) | ||
| ) | ||
| def leafy(thing): | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -14,6 +14,7 @@ deps = | ||
| hypothesis | ||
| mock | ||
| nose | ||
| six | ||
| commands = nosetests {posargs} | ||
| [testenv:flake8] | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import