Why do I get the error `listed is not defined` in the following code snippet?

```
import socket,select
from threading import *
import time

neighbours=[]
def neighbourfuncall():
    print('In neighbours')

class pyserver(Thread):
    dictn={}
    HOST=socket.gethostname()
    PORT=8888
    buf=1024
    ADDR=(HOST,PORT)
    listed=[]
    sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    sock.bind(ADDR)    
    sock.listen(30)

    def __init__(self):
        self.interval=6
        listed.append(sock)
        thread=threading.Thread(target=neighbourfuncall,args=())
        thread.daemon=True
        thread.start()
    def run(self):
        while True:
            sel,out,spl=select.select(listed,[],[],15.0)
            for s in sel:
                if s==sock:
                    client,address=sock.accept()
                    listed.append(client)
                    dest=client.recv(buf)
                    dictn[client]=dest      
                else:
                    pass

serv=pyserver()  
serv.run()

```