get object attributes python
for att in dir(your_object):
print (att, getattr(your_object,att))
get object attributes python
for att in dir(your_object):
print (att, getattr(your_object,att))
python property
class Number:
def __init__(self, number):
self.__number = number
def get_number(self):
print("Getting...")
return self.__number
def set_number(self, number):
print("Setting...")
self.__number = number
def del_number(self):
print("Deleting...")
del self.__number
nb = property()
nb = nb.getter(get_number)
nb = nb.setter(set_number)
nb = nb.deleter(del_number)
n = Number(42)
print(n.nb)
n.nb = 69
print(n.nb)
del n.nb
# Getting...
# 42
# Setting...
# Getting...
# 69
# Deleting...
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