Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-line-docstrings  One line docstrings should fit on one line and end with a period
  • Loading branch information
jbampton authored and chriddyp committed Dec 1, 2017
1 parent d2e27bf commit 12f9b50
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions dash/development/base_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,15 @@ def __getitem__(self, id):
return self._get_set_or_delete(id, 'get')

def __setitem__(self, id, item):
"""Set an element by its ID
"""
"""Set an element by its ID."""
return self._get_set_or_delete(id, 'set', item)

def __delitem__(self, id):
"""Delete items by ID in the tree of children
"""
"""Delete items by ID in the tree of children."""
return self._get_set_or_delete(id, 'delete')

def traverse(self):
"""Yield each item in the tree"""
"""Yield each item in the tree."""
children = getattr(self, 'children', None)

# children is just a component
Expand All @@ -149,17 +147,15 @@ def traverse(self):
yield t

def __iter__(self):
"""Yield IDs in the tree of children
"""
"""Yield IDs in the tree of children."""
for t in self.traverse():
if (isinstance(t, Component) and
getattr(t, 'id', None) is not None):

yield t.id

def __len__(self):
"""Return the number of items in the tree
"""
"""Return the number of items in the tree."""
# TODO - Should we return the number of items that have IDs
# or just the number of items?
# The number of items is more intuitive but returning the number
Expand Down

0 comments on commit 12f9b50

Please # to comment.