The @classmethod decorator

The decorator @classmethod turns a function into a class method which does not depend of self but receives the class. These kind of functions can be used to add extra constructors:

#!/usr/bin/env python

class cl1(object):
    def __init__( self):
        pass
    
    @classmethod
    def constructor1( klass, town):
        self = klass()
        self.town = town
        return self
    pass

c1 = cl1.constructor1( 'Paris')
print( c1.town)