How to call static methods in functions? Scope of static methods

Suppose I create a class with a static method and want to run that method from another classes method or script function.

What is the scope of the static method?


def Class myClass:

     def mystaticmethod(input):

def scriptfunc():

Is this valid?


  • What you have is valid.

    But too elaborate on the purpose of @staticmethod, here's Short answer:

    Declaring a @staticmethod would mean 2 things:

    1. You don't care about the properties or attributes of a method as it's independent of other classes,
    2. You do not require creating an __init__ or a super method to override it's content or attributes, and doesn't require a subclass/parent class to handle itself.