You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
539681fffd
From now on, all new tests must use underscore. Addresses issue #727.
33 lines
414 B
Python
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")
|