Override class __str__ function : Class str « Class « Python






Override class __str__ function

Override class __str__ function
 
       
class MyMeta:
    def __str__(cls): 
       return "Beautiful class "

x = MyMeta()

print x


           
         
  








Related examples in the same category

1.__str__ , __repr__ __str__ , __repr__
2.overriding built-in __str__() method