ID EN
Built-in Functions

staticmethod

Python 3.11

Transform a method into a static method.

Syntax

PYTHON
@staticmethod

Examples

Example 1
PYTHON
class C:
    @staticmethod
    def f(arg1, arg2, argN): ...
Example 2
PYTHON
def regular_function():
    ...

class C:
    method = staticmethod(regular_function)

See Also

decorator Function definitions classmethod() The standard type hierarchy