Skip to main content

reclassmethod

Wraps a method by extracting its underlying function and converting it into a class method.

def reclassmethod(
method: callable
) - > classmethod

Converts a bound method or a function into a class method by extracting its underlying function and wrapping it with the classmethod decorator.

Parameters

NameTypeDescription
methodcallableThe method or function to be converted into a class method.

Returns

TypeDescription
classmethodA class method object that can be called on the class rather than an instance.