2016-10-24 03:50:39 +01:00
|
|
|
# test builtin delattr
|
2017-02-14 21:57:56 +00:00
|
|
|
try:
|
|
|
|
delattr
|
|
|
|
except:
|
|
|
|
print("SKIP")
|
2017-06-10 18:03:01 +01:00
|
|
|
raise SystemExit
|
2016-10-24 03:50:39 +01: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')
|