Skip to content

Commit

Permalink
minor: format fixes, comments clarifications
Browse files Browse the repository at this point in the history
  • Loading branch information
randomir committed Aug 22, 2017
1 parent a9fad19 commit 4bb2dda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions plucky/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@

# safe unicode classname
try:
unicode = unicode
unicode = unicode
except:
unicode = str
unicode = str
12 changes: 6 additions & 6 deletions plucky/structural.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def __init__(self, obj=None, default=None, skipmissing=True,
nodes -- which always default to the ``default`` when missing.
(2) one-on-one extractor (explict mode), which will include all missing
values as ``default``, ensuring the leaf values exist even when one (or
more) intermediate nodes are missing.
values as ``default``, ensuring the leaf values exist even when one
(or more) intermediate nodes are missing.
"""
self.obj = obj
self.default = default
Expand Down Expand Up @@ -209,10 +209,10 @@ def _get_all(self, *selectors):
def __getattr__(self, name):
"""Handle ``obj.name`` lookups.
obj.key -> the same as obj["key"]: if obj is a dict, extract value
under key "key" (or default val), if obj is a list,
iterate over all elements, extracting "key" from each
element
obj.key -> similar to obj["key"], but with preferrence on attributes vs items.
If obj is a dict, and "key" is not a valid `dict` attribute, extract
dict value under key "key" (or default val). If obj is a list,
iterate over all elements, extracting "key" from each element
"""
return self._get_all(AttrSelector(name))

Expand Down

0 comments on commit 4bb2dda

Please sign in to comment.