python monkey patch
Q: Is that something like methods/operators overloading or delegating? A: NO, It's simply the dynamic replacement of attributes at runtime.
methods are just attributes of the class, you can do this as much as you like
実は、以下をみてて、monkey patch?となった。まだ、自分は知識も考えも足りない。
code: except.py
setattr(httplib2, '_HttpOriginal', httplib2.Http)
httplib2.Http = Http #Httpは別途 class Http(httplib2.Http で作成(定義) したもの 元のmethodは、
これで、根っこのruntimeレベルで差し替えに成功してる。たぶん。
参考:
setattr(object, name, value)