Static methods do not require object creation.

A static method can always be called, but is part of a class.

Method requires you to create an object: Not the case with static methods.

Related course: Complete Python Bootcamp: Go from zero to hero in Python 3

static methods example

Class method
A non static method needs an object to be initialized:

class Spaceship(object):
def start(self):

obj = Spaceship()

The self keyword in the start method refers to the object. Because static methods can be called without object creation, they do not have a self keyword.

Static method
Create a class and add a method. You should explicitly define it’s a static method by adding @staticmethod.

Once you defined the class, you can call the methods directly.

class Spaceship(object):

def start():


This calls the method without creating an object. Unlike normal class methods, they do not have access to objects variables.

This may be odd, as it seems counter to the concept of object orientated programming.

In most of the computer software you’ll find regular class methods. Static methods are usually used as helpers.

Download exercises