[blivet:master 14/20] Change docstrings to comments
Vratislav Podzimek
vpodzime at redhat.com
Tue Apr 15 07:43:49 UTC 2014
On Fri, 2014-04-11 at 14:03 -0400, mulhern wrote:
> When the docstrings are in this position python thinks they are expressions
> to be evaluated in the normal way.
>
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
> blivet/devices.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/blivet/devices.py b/blivet/devices.py
> index f309d3f..09d780c 100644
> --- a/blivet/devices.py
> +++ b/blivet/devices.py
> @@ -154,11 +154,11 @@ class ParentList(object):
> if items:
> self.items.extend(items)
>
> + # a function to call before adding an item
> self.appendfunc = appendfunc or (lambda i: True)
> - """ a function to call before adding an item """
>
> + # a function to call before removing an item
> self.removefunc = removefunc or (lambda i: True)
> - """ a function to call before removing an item """
>
> def __iter__(self):
> return iter(self.items)
According to the PEP 257 [1] these are valid docstrings. So if pylint
reports them as statements with no effects, it should be fixed or
supressed.
[1] http://legacy.python.org/dev/peps/pep-0257/#what-is-a-docstring
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list