A notebook for testing class methods.
In [31]:
class A(object):
v = {'a': 3}
@classmethod
def f(cls):
print 'In A'
class B(object):
v = 5
@classmethod
def f(cls):
print 'In B'
In [32]:
a = A()
a.__class__.f()
In [33]:
B.f()
In [34]:
b = B()
b.f()
In [35]:
a.f()
In [36]:
print A.v
print B.v
In [37]:
a.v
Out[37]:
In [38]:
b.v
Out[38]:
In [39]:
a.__class__.v
Out[39]:
In [41]:
x=3
In [ ]:
In [ ]:
In [ ]: