2016-10-23 22:50:39 -04:00
|
|
|
# test builtin delattr
|
2017-02-14 16:57:56 -05:00
|
|
|
try:
|
|
|
|
delattr
|
|
|
|
except:
|
|
|
|
print("SKIP")
|
2017-06-10 13:03:01 -04:00
|
|
|
raise SystemExit
|
2016-10-23 22:50:39 -04:00
|
|
|
|
|
|
|
class A: pass
|
|
|
|
a = A()
|
|
|
|
a.x = 1
|
|
|
|
print(a.x)
|
|
|
|
|
|
|
|
delattr(a, 'x')
|
|
|
|
|
|
|
|
try:
|
|
|
|
a.x
|
|
|
|
except AttributeError:
|
|
|
|
print('AttributeError')
|
|
|
|
|
|
|
|
try:
|
|
|
|
delattr(a, 'x')
|
|
|
|
except AttributeError:
|
|
|
|
print('AttributeError')
|