types.MethodType for Python3