circuitpython/tests/basics/del_attr.py
Damien George 539681fffd tests: Rename test scripts, changing - to _ for consistency.
From now on, all new tests must use underscore.

Addresses issue #727.
2014-07-05 06:14:29 +01:00

33 lines
414 B
Python

class C:
def f():
pass
# 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")