From 12f9b50e442541c3b614de201b3fb9d1b8a7f722 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Fri, 1 Dec 2017 08:16:33 +1000 Subject: [PATCH] Fix one line docstrings https://www.python.org/dev/peps/pep-0257/#one-line-docstrings One line docstrings should fit on one line and end with a period --- dash/development/base_component.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/dash/development/base_component.py b/dash/development/base_component.py index bd108addbe..a81a4feb6b 100644 --- a/dash/development/base_component.py +++ b/dash/development/base_component.py @@ -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 @@ -149,8 +147,7 @@ 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): @@ -158,8 +155,7 @@ def __iter__(self): 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