f4c9b33abf
This makes the runtime and object APIs more consistent. mp_store_subscr functionality now moved into objects (ie list and dict store_item).
29 lines
378 B
Python
29 lines
378 B
Python
# del a class attribute
|
|
|
|
del C.f
|
|
try:
|
|
print(C.x)
|
|
except AttributeError:
|
|
print("AttributeError")
|
|
try:
|
|
del C.f
|
|
except AttributeError:
|
|
print("AttributeError")
|
|
|
|
# del an instance attribute
|
|
|
|
c = C()
|
|
|
|
c.x = 1
|
|
print(c.x)
|
|
|
|
del c.x
|
|
try:
|
|
print(c.x)
|
|
except AttributeError:
|
|
print("AttributeError")
|
|
try:
|
|
del c.x
|
|
except AttributeError:
|
|
print("AttributeError")
|