mardi 12 février 2019

class with only class methods

Class with only class methods

I have a class with only class methods. Is it a Pythonic way of namespacing if not what will be the best way to group similar kind of methods?.

class OnlyClassMethods(object):
    @classmethod
    def method_1(cls):
        pass

    @classmethod
    def method_2(cls):
        pass 

Can I have a class with only class methods?

Aucun commentaire:

Enregistrer un commentaire