Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python generator cheat sheet download

class <name>:
    def __init__(self, a):
        self.a = a
    def __repr__(self):
        class_name = self.__class__.__name__
        return f'{class_name}({self.a!r})'
    def __str__(self):
        return str(self.a)

    @classmethod
    def get_class_name(cls):
        return cls.__name__
Source by gto76.github.io #
 
PREVIOUS NEXT
Tagged: #python #generator #cheat #sheet #download
ADD COMMENT
Topic
Name
5+3 =