This question shows research effort; it is useful and clear
1
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
是否可以在没有类实例的情况下访问类成员?例如:
class MyClass(object):
MyMember = 1
class MyOtherClass(object):
def __init__(self):
print MyClass.MyMember #MyClass().MyMember works out but not MyClass.MyMember