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