fork download
  1. #利用完全动态的__getattr__,链式调用
  2. class chain(object):
  3. def __init__(self,path=''):
  4. self._path=path
  5. def __getattr__(self,path):
  6. return ('%s/%s'%(self._path,path))
  7. def __str__(self):
  8. return self._path
  9. __repr__=__str__
  10. # your code goes here
  11. # your code goes here
  12. # your code goes here
Success #stdin #stdout 0.15s 14092KB
stdin
Standard input is empty
stdout
Standard output is empty