I want to construct a class to flatten a python list. I can make it by defining function like this;
liste=[[1,2],3,[4],[[5],6]]
flatLIST=[]
def recur(a):
    if (type(a)==list):
        for i in a:
           recur(i)
    else:
        flatLIST.append(a)
recur(liste)
flatLIST
[1, 2, 3, 4, 5, 6]
But when i cannot achieve it by constructing a class.
class flatYVZ():
    def __init__(self,liste):
        self.flatLIST=[]
        recur(liste)
    def recur(self,a):
        if (type(a)==list):
            for i in a:
                recur(i)
        else:
            self.flatLIST.append(a)
    def flatting(self):        
        self.sonuc=self.flatLIST
example=[[1,2],3,[4],[[5],6]]
objec=flatYVZ(example)
objec.sonuc
[]
 
    