class Class:
_member = 1
def method(self):
I want to access _member
from within method()
, what is the correct way to do so?
You can use self._member
, if it isn't an attribute of the object (in self.__dict__
) I believe it looks in the classes __dict__
next, which should contain the class attributes.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加