Discuss / Python / 请指教

请指教

Topic source

lina19820525

#1 Created at ... [Delete] [Delete and Lock User]
class Chain(object):    def __init__(self, path=''):        self._path = path    def __getattr__(self, path):        return Chain('%s/%s' % (self._path, path))    def __str__(self):        return self._path    def __call__(self, path):        return Chain('%s/%s' % (self._path, path))    __repr__ = __str__print(Chain().users('micheal').list)

  • 1

Reply