This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author carlbordum
Recipients bjonnh, carlbordum, docs@python, rhettinger
Date 2019-03-18.10:38:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1552905538.78.0.462182388117.issue23984@roundup.psfhosted.org>
In-reply-to
Content
I submitted a PR that addresses this and the next example, which also uses print unnecessarily.

To answer your last comment rhettinger; the preceding text tells you /why/ one might want to use a staticmethod:

"""
Good candidates for static methods are methods that do not reference the
``self`` variable.

For instance, a statistics package may include a container class for
experimental data.  The class provides normal methods for computing the average,
mean, median, and other descriptive statistics that depend on the data. However,
there may be useful functions which are conceptually related but do not depend
on the data.  For instance, ``erf(x)`` is handy conversion routine that comes up
in statistical work but does not directly depend on a particular dataset.
It can be called either from an object or the class:  ``s.erf(1.5) --> .9332`` or
``Sample.erf(1.5) --> .9332``.

Since staticmethods return the underlying function with no changes, the example
calls are unexciting::
"""
History
Date User Action Args
2019-03-18 10:38:58carlbordumsetrecipients: + carlbordum, rhettinger, docs@python, bjonnh
2019-03-18 10:38:58carlbordumsetmessageid: <1552905538.78.0.462182388117.issue23984@roundup.psfhosted.org>
2019-03-18 10:38:58carlbordumlinkissue23984 messages
2019-03-18 10:38:58carlbordumcreate