python错误类型
BaseException +– SystemExit +– KeyboardInterrupt +– GeneratorExit +– Exception +– StopIteration +– StopAsyncIteration +– ArithmeticError | +– FloatingPo…
阅读全文 »已阅读 795 次BaseException +– SystemExit +– KeyboardInterrupt +– GeneratorExit +– Exception +– StopIteration +– StopAsyncIteration +– ArithmeticError | +– FloatingPo…
阅读全文 »已阅读 795 次# 使用type创建class def fn(self, name=’world’): print(‘Hello, %s.’ % name) Hello = type(‘Hello’, (object,), dict(hello=fn)) h = Hello() h.hello(‘Mac’)
阅读全文 »已阅读 851 次今天继续学习python,学到了定制类,用到了__getattr__和__call__以及__str__ class Chain(object): def __init__(self, path=”): self._path = path def __getattr__(self, path): return Cha…
阅读全文 »已阅读 1,645 次