很奇怪的是,我的代码在我的笔记本电脑中通过了所有 UT/IT,但在 github CI 中却遇到了错误。您介意帮忙学习一些在 github CI 中调试的方法吗?或者让代码像github一样在本地运行?
这是一个关于时间序列数据库 Apache-IoTDB 的项目。该错误看起来像是普通代码中的一个微不足道的逻辑错误。希望它可以帮助诊断错误。非常感谢 !
代码优先:
def another_func(func):
func()
def outer_func(pa=1, pb=2):
def inner_func():
print(pa)
print(type(inner_func))
another_func(inner_func)
if __name__ == '__main__':
outer_func()
#print "1"
Run Code Online (Sandbox Code Playgroud)
我不知道的是,"inner_func"呼叫"outer_func"的参数,但在"outer_func"的身体.当another_func调用时,它怎么能"知道"有一个"pa"?
我的意思是,当它在"outer_func"中调用时,实际传递给another_func的是什么?似乎不仅仅是函数对象的引用.