module.__dict__ python
class MyClass(object):
class_var = 1
def __init__(self, i_var):
self.i_var = i_var
foo = MyClass(2)
bar = MyClass(3)
print MyClass.__dict__
print foo.__dict__
print bar.__dict__
module.__dict__ python
class MyClass(object):
class_var = 1
def __init__(self, i_var):
self.i_var = i_var
foo = MyClass(2)
bar = MyClass(3)
print MyClass.__dict__
print foo.__dict__
print bar.__dict__
module.__dict__ python
{'__module__': '__main__', 'class_var': 1, '__dict__': <attribute '__dict__' of 'MyClass' objects>, '__weakref__': <attribute '__weakref__' of 'MyClass' objects>, '__doc__': None, '__init__': <function __init__ at 0x0000000004E55CF8>}
{'i_var': 2}
{'i_var': 3}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us