静态方法,我知道这是连接到有这样的情况下,但不知何故,我知道了: class foo
#static method
@staticmethod
def test():
pass
# class variable
c = {'name' : <i want to reference test method here.>}
有什么办法呢
我有一个基类A与恒定的静态变量a。我需要类B的实例对静态变量a有不同的值。这怎么能实现,最好是静态初始化? class A {
public:
static const int a;
};
const int A::a = 1;
class B : public A {
// ???
// How to set *a* to a value specific