擅长:python、mysql、java
<p>您的<code>MATRIX</code>不是全局的,它是一个类属性,请这样尝试:</p>
<pre><code>class test:
MATRIX = []
@classmethod # Note classmethod, not staticmethod
def fun1(cls): # cls will be test here
test.fun2(cls.MATRIX)
@staticmethod
def fun2(MATRIX):
MATRIX.append(2)
test.fun1()
print test.MATRIX
</code></pre>