summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/builtin_delattr.py
blob: 65bd0f210d59088d8fce85f66c26f31b79897fc1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# test builtin delattr
try:
    delattr
except:
    print("SKIP")
    raise SystemExit

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')