Disallow _private methods to be hooked

这个提交包含在:
Chase Sterling 2016-07-13 21:05:49 -04:00
父节点 eafff2ae43
当前提交 533e52945d
共有 1 个文件被更改,包括 3 次插入0 次删除

查看文件

@ -27,6 +27,9 @@ class HookMixinMeta(type):
hookable = []
for key, value in attrs.items():
# Disallow hooking methods which start with an underscore (allow __init__ etc. still)
if key.startswith('_') and not key.startswith('__'):
continue
if callable(value):
attrs[key] = hook_func(key, value)
hookable.append(key)