반응형

 

class variable

이게 생각보다 오묘하다

위의 예제를 보면 일반적인 class level의 글로벌 변수 즉 static variable로 보인다.

클래스를 통한 assign은 모든 instance로 전파가 된다.

그런데 instance를 통해 assign을 하는순간 얘기가 달라진다.

위와 같이 instance 를 통한 assign은 전파가 안된다;;

http://stackoverflow.com/questions/68645/static-class-variables-in-python

This is different from C++ and Java, but not so different from C#, where a static member can't be accessed using a reference to an instance.

반응형

+ Recent posts