Discuss / Python / 有问题吗?

有问题吗?

Topic source

仄庂仄

#1 Created at ... [Delete] [Delete and Lock User]

class Chain(object): def init(self,path=''): self._path=path

def users(self,u):
    return Chain('/users/%s'%u)

def __getattr__(self, path):
    return Chain('%s/%s'%(self._path,path))

def __str__(self):
    return self._path

__repr__ = __str__

  • 1

Reply