阅读背景:

Python中的实例变量与类变量

来源:互联网 

I have Python classes, of which I need only one instance at runtime, so it would be sufficient to have the attributes only once per class and not per instance. If there would be more than one instance (which won't happen), all instance should have the same configuration. I wonder which of the following options would be better or more "idiomatic" Python.I have Python classes, of which I need only one




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: