Discuss / Python / Chain().users('michael').repos 解决方法

Chain().users('michael').repos 解决方法

Topic source

绊倒铁盒

#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 __call__(self, *args, **kwargs):
        return Chain('%s/%s' % (self._path, args[0]))


    def __str__(self):
        return self._path


    __repr__ = __str__


  • 1

Reply