理解与作用域之间存在一些意想不到的交互。这是预期的行为吗?Interestingly, it's rebound to the last uid in the list, so the error only shows冒着抱怨的风险,这是一个残酷的错误来源。在我编写新代码时,我只是偶尔会发现由于重新绑定而出现的非常奇怪的错误--即使<
我对结合列表理解和eval语句的方法感到困惑。test7行下面的错误代码和错误NameError: name 'a2' is not defined。= test_class()test2 = [eval('a.property') for i in range(10)]它必须与范围我对python 2中的范围的理解(我刚刚