Carl Bordum Hansen <c...@bordum.dk> added the comment:
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:: """ ---------- nosy: +carlbordum versions: +Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue23984> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com