On Fri, Sep 11, 2020 at 7:27 PM <2qdxy4rzwzuui...@potatochowder.com> wrote:
> But no extraneous cognitive noise? By definition, methods appear inside > a class definition, and then I have to process the @staticmethod > decorator. Effectively, the decorator "cancels" the class method status > of the function. I can accomplish the same thing with clean > module-level function, modulo the specific namespace in which the > function is created. > Exactly. This question asked why staticmethod when we have classmethod. But the real question is why staticmethod at all? And the answer is that there is very little use for staticmethod in Python -- all it does is put a regular function in the class' namespace, and since we have modules to be nice namespaces for functions, there is little need for it. Sometimes it does make sense to keep some functionality all bundled together with a class, but I find it pretty rare. -CHB -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/ZGIJ3QJMNMZLNIWLTGFXPH3A73NDEWUM/ Code of Conduct: http://python.org/psf/codeofconduct/