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